UTF-8 BOM marker @iniread failure

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
May 31, 2008
376
2
#1
I have a UTF-8 encoded file.ini with the following contents where *BOM* represents the 2-byte unicode marker:

*BOM*[Section]
Target=..\file.ext

@iniread[".\file.ini",Section,Target] always returns the null string instead of the Target field value. After re-encoding file.ini to remove the BOM marker @iniread works correctly, so I'm thinking that @iniread get's confused by the BOM marker.
Versions: TCC 12.60, Windows XP 32.
 

rconn

Administrator
Staff member
May 14, 2008
10,103
85
#2
I have a UTF-8 encoded file.ini with the following contents where *BOM* represents the 2-byte unicode marker:

*BOM*[Section]
Target=..\file.ext

@iniread[".\file.ini",Section,Target] always returns the null string instead of the Target field value. After re-encoding file.ini to remove the BOM marker @iniread works correctly, so I'm thinking that @iniread get's confused by the BOM marker.
@INIREAD (like most things in TCC and Windows, and everything in CMD) does not support UTF-8. Use UTF-16.