So some of the strings I write into .ini file are causing problems. Like the following string for example: "José_Luis"
How do I edit strings to remove or replace the offensive special characters?
Unicode characters in INI files
Re: Unicode characters in INI files
I did not see a problem, but below are some ideas.
https://www.autohotkey.com/board/topic/92405-is-it-possible-to-remove-all-unicode-characters/
https://www.autohotkey.com/board/topic/92405-is-it-possible-to-remove-all-unicode-characters/
Re: Unicode characters in INI files
How do you create/update your INI file? (é looks like UTF-8)
Re: Unicode characters in INI files
So'kay guys. You all got it wrong because I presented the wrong problem.
As it turns out, with the following command: IniRead,temp,example.ini,section,%var% if var="", it dumps the entire section into the temp variable
As it turns out, with the following command: IniRead,temp,example.ini,section,%var% if var="", it dumps the entire section into the temp variable
Re: Unicode characters in INI files
Yes, it is known that a section can be read when a key is not specified-- on the first page of the documentation about IniRead.
Re: Unicode characters in INI files
Note that the documentation states that the contents of an INI file must either be ANSI or UTF-16. UTF-8 is not permitted.
Cheers
Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Unicode characters in INI files
just a basic example for iniread/write ( not answer to unicode )
( ahk script is saved with notepad as 'UTF-8 with BOM' , copied chinese characters to edit-field , content from INI-file was OK )
( ahk script is saved with notepad as 'UTF-8 with BOM' , copied chinese characters to edit-field , content from INI-file was OK )
Code: Select all
#Warn
#NoEnv
SetWorkingDir %A_ScriptDir%
RSSINI=%A_scriptdir%\RSSINI.ini ;- can also be a textfile xy.txt
;---------------------------------------
ifnotexist,%rssini%
{
IniWrite, Bocquet , %rssini% ,A1 , KEY1
IniWrite,José-Louis , %rssini% ,A2 , KEY1
IniWrite,+31-01-12345678 , %rssini% ,A3 , KEY1
}
IniRead, A1, %rssini% , A1 , Key1
IniRead, A2, %rssini% , A2 , Key1
IniRead, A3, %rssini% , A3 , Key1
Gui,2: Add, text, x10 y10 , Name
Gui,2: Add, text, x10 y35 , Lastname
Gui,2: Add, text, x10 y60 , Telephon
Gui,2: Add, Edit, x100 y10 w100 vC1,%A1%
Gui,2: Add, Edit, x100 y35 w100 vC2,%A2%
Gui,2: Add, Edit, x100 y60 w100 vC3,%A3%
Gui,2: Add, Button,x100 y90 gSave,SAVE
Gui,2: Add, Button,x10 y90 gClear,CLEAR
Gui,2: Add, Button,x10 y120 gINIFile , Open-INI
Gui,2: Show,, NameList
send,^{end}
return
;---------------------------------------
2Guiclose:
exitapp
;---------------------------------------
Clear:
loop,3
GuiControl,2:,C%a_index%,
return
;---------------------------------------
Save:
Gui,2: Submit,nohide
IniWrite, %C1% , %rssini% ,A1 , KEY1
IniWrite, %C2% , %rssini% ,A2 , KEY1
IniWrite, %C3% , %rssini% ,A3 , KEY1
return
;---------------------------------------
INIFILE:
run,notepad "%rssini%"
return
;=======================================