Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Support UTF-8 for IniWrite and IniRead


  • Please log in to reply
2 replies to this topic
  • Guests
  • Last active:
  • Joined: --
When writing a INI file manually, it's troublesome that the file encoding has to be specified to UTF-16.

This demonstrates the problem.
FileEncoding, UTF-8
IniFile := A_ScriptDir "\test.ini"
FileDelete, % IniFile
FileAppend, 
	(Ltrim
		[Section]
		Key=Hi
	) 
	, % IniFile
IniRead, OutputVar, % IniFile, Section, Key
msgbox % OutputVar		;yields Error
IniWrite, Hello, % IniFile, Section, Key
Run, % IniFile
I know it's already been discussed. AHKL: IniRead/IniWrite and UTF8. However, it would be more non-programmer friendly if UTF-8 is natively supported.