Jump to content

getting / writing asian characters [Solved]


Recommended Posts

For some reason, when i get the title of a webpage that has asian characters in it, it writes "???????" for those characters.

Does anyone know the reson why?

$title = WinGetTitle("[active]")
FileWriteLine($file,$title)
Edited by redcrusher
Link to comment
Share on other sites

You have to open a file with the Unicode flag.

Try this:

$hFile = FileOpen(@ScriptDir & "\TEST.txt", 129) ; UTF-8 Unicode Writing Mode (128 for UTF-8 + 1 for Writing mode = 129)
$sTitle = "テスト タイトル - 日本語"
FileWriteLine($hFile, $sTitle)
FileClose($hFile)

Don't forget that you have to make sure your editor (atleast with Scite) is set to the proper encoding as well (UTF-8 with BOM should do) or it won't compile.

Link to comment
Share on other sites

You have to open a file with the Unicode flag.

Try this:

$hFile = FileOpen(@ScriptDir & "\TEST.txt", 129) ; UTF-8 Unicode Writing Mode (128 for UTF-8 + 1 for Writing mode = 129)
$sTitle = "テスト タイトル - 日本語"
FileWriteLine($hFile, $sTitle)
FileClose($hFile)

Don't forget that you have to make sure your editor (atleast with Scite) is set to the proper encoding as well (UTF-8 with BOM should do) or it won't compile.

PERFECT! ;)

thank you

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...