Hey guys
Can anyone help me explain this?
$szFile = "test.htm"
$szText = FileRead($szFile)
$szText = StringReplace($szText, "hello", "ö")
FileDelete($szFile)
FileWrite($szFile,$szText)
If the file "test.htm" has it's text changed into something containing non US characters, in this example "ö", the output is " ö " when shown in a browser.
If i manually change the text in the "test.htm" file to "ö" - the output in the browser is "ö" !
In both cases, if the htm file is opened in notepad, the content is just "ö" - but the one changed from the script, still opens as " ö " in a browser. How weird is this?
I am aware that I can replace the text to " ö" , which is the HTML code for "ö" - then the output is correct in the browser, but this is just dumb when there are a lot of characters to be changed
Does anyone know why this happens, and how to solve it in a more simple way?