[SOLVED] UTF-8 text manipulation

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
vasili111
Posts: 747
Joined: 21 Jan 2014, 02:04
Location: Georgia

[SOLVED] UTF-8 text manipulation

12 Apr 2015, 07:47

This is my code:

Code: Select all

FileReadLine, content, a.txt, 1
FileAppend, %content%, b.txt
This is the content of a.txt . It has (text editor says) codepage 65001 (UTF-8) .

Code: Select all

μ - Mu
This is the content of b.txt which I get after running script. It has (text editor says) codepage 65001 (UTF-8) without BOM .

Code: Select all

? - Mu
Why this happens? The problem is in code, AutoHotkey, text editor (AkelPad) or I need to use different codepage?
Last edited by vasili111 on 12 Apr 2015, 08:39, edited 1 time in total.
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
jpginc
Posts: 124
Joined: 29 Sep 2013, 22:35

Re: UTF-8 text manipulation

12 Apr 2015, 08:21

try using the encoding option of fileAppend

ie

Code: Select all

FileAppend, %content%, b.txt, UTF-8

vasili111
Posts: 747
Joined: 21 Jan 2014, 02:04
Location: Georgia

Re: UTF-8 text manipulation

12 Apr 2015, 08:33

I found the problem. If a.txt has codepage 65001 (UTF-8) without BOM my script works fine. The problem was in BOM. Maybe AutoHotkey needs some extra settings to work with it or BOM is not supporting in AutoHotkey. More about BOM here: http://stackoverflow.com/questions/2223 ... ithout-bom

Anyway now my script works fine, so problem for me is solved.
DRAKON-AutoHotkey: Visual programming for AutoHotkey.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Joey5 and 222 guests