7 posts in this topic
I need help with unicode char Ã¼ I get some text from online json but if try to read 4 example Zürich I heave ZÃ¼rich.
How can I convert with autoit unicode to a clear character readable? thx
i need to save files with ANSI-Encoding. Since 126.96.36.199 Auto-It it doesn't work in any direction.
I tried the following:
#include <FileConstants.au3> FileDelete(@ScriptDir&"\Test.txt") $o = FileOpen(@ScriptDir&"\Test.txt", BitOR($FO_BINARY,$FO_ANSI,$FO_OVERWRITE)) FileWrite($o, "Test") FileClose($o) Or
#include <FileConstants.au3> FileDelete(@ScriptDir&"\Test.txt") $o = FileOpen(@ScriptDir&"\Test.txt", 514) FileWrite($o, "Test") FileClose($o) Both create UTF-8 encoded files.
What am i doing wrong?
I'm using the code below to send mails using our internal relay server.
We got a Helpdesk system named Remedy. Our users can send us a mails using outlook 2010, and we'll get a ticket.
The problem is if I send a mail using the above script our ticket system can't display unicode characters, like ex: Æ Ø Å. It will display them as: questionmarks: "? ? ?" inside our ticket system. In the outlook inbox it looks fine showing unicode symbols, but in our ticket system the unicode characters will be replaced by questionmarks.
The thing is, if they send a mail using outlook, it works fine, but using the script above it doesen't.
I tried to save my script with encoding: UTF-8 with BOM, but it didn't fix it.
All suggestions are very welcome
I've ported toUTF8() function (truly, the whole Encoding class) by Sebastián Grignoli to AutoIt. It offers useful functions to force a string to be in a specified charset in a really easy way.
From the readme file:
$utf8_string = toUTF8($utf8_or_latin1_or_mixed_string) $latin1_string = toLatin1($utf8_or_latin1_or_mixed_string) Also:
$utf8_string = fixUTF8($garbled_utf8_string) fixUTF8() converts the string to UTF-8 repeatedly until make sure it has only UTF-8 valid chars (it's really UTF-8).
#include 'forceutf8.au3' MsgBox(0, '', fixUTF8( 'Ã£Ã©' ) ) Will output:
ãé Note that it's just a port. If you look at both the source codes together (PHP and AutoIt), you'll see that they're exactly the same thing, but in different approaches (PHP arrays converted to Scripting.Dictionary objects, function renames, syntax porting, a few functions completely rewritten due to differences between PHP and AutoIt). Therefore, all credits goes to Sebastián Grignol.
It seems that it works only with latin/roman alphabet (used by English).
Download ZIP from Github
Fork me on Github
sqlite database written in ANSI code reading？The current version is based on UTF 8 encoding to read and write。
UNICODE or ANSI transfer method