1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

UTF-8 BOM marker @iniread failure

Discussion in 'Support' started by Stefano Piccardi, Jun 9, 2011.

  1. Stefano Piccardi

    Joined:
    May 31, 2008
    Messages:
    376
    Likes Received:
    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.
    Versions: TCC 12.60, Windows XP 32.
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,732
    Likes Received:
    81
    @INIREAD (like most things in TCC and Windows, and everything in CMD) does not support UTF-8. Use UTF-16.
     
  3. Stefano Piccardi

    Joined:
    May 31, 2008
    Messages:
    376
    Likes Received:
    2
    Thanks, UTF-16 isn't an option as I receive these files from others. I'll work around it.
     
  4. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,280
    Likes Received:
    38
    Insert a newline before the first section header?
     
  5. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,732
    Likes Received:
    81
    You receive UTF-8 Windows .INI files from others?? Since Windows cannot handle them, I don't understand the purpose.
     
  6. Stefano Piccardi

    Joined:
    May 31, 2008
    Messages:
    376
    Likes Received:
    2
    Tried that before, didn't make any difference.
     
  7. Stefano Piccardi

    Joined:
    May 31, 2008
    Messages:
    376
    Likes Received:
    2
    A special program can/does handle them. I can't tell you more, I don't have access to the program source file.
     

Share This Page