I can see the value of this wish and would like to encourage
guest (or another interested party) to write an alternative to
GetPrivateProfileString/WritePrivateProfileString that is aware of the file's encoding (and the script's codepage).
As a work around, you may have your script create a temporary copy of your ini file with utf-16 encoding, and use that for iniread/iniwrite until your script is ready to close, then you can convert the entire file back to utf-8 for storage.
Code:
IfNotExist, my.ini.tmp
{
FileRead, my_ini_blob, *P65001 my.ini
FileAppend, % my_ini_blob, my.ini.tmp, UTF-16-RAW
}
; the rest of the script uses my.ini.tmp for ini operations
; ... script goes here ...
; when the script is ready to close, do this:
FileRead, my_ini_blob, *P1200 my.ini.tmp
FileDelete, my.ini
FileAppend, % my_ini_blob, my.ini, UTF-8-RAW
FileDelete, my.ini.tmp