non-unicode app reading unicode texts

This is a discussion on non-unicode app reading unicode texts within the Windows Programming forums, part of the Platform Specific Boards category; Hi all, i'm working on a simple script compiler that reads sort of *.ini files. The app is compiled on ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    47

    Question non-unicode app reading unicode texts

    Hi all,

    i'm working on a simple script compiler that reads sort of *.ini files.
    The app is compiled on a win98 with non-unicode options.

    Is there a clean way how to recognize that someone has written a *.ini file on a Win2000/NT/XP ?

    I though of simply test the 1st 16bit if the upper byte is 0x00.

    How would you do it ?
    Is there a more generalized way ?

    -
    Robert

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    Ini files (asuming they are standard text) are stored in 8bit chars.....just read them in as normal

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    47
    Hi Fordy,
    but when editing something on Win2000/NT/XP aren't the files saved as UNICODE text files.
    Depends the format of the text on the filename suffix ??

    I don't have a Win2000 at home.

    -
    Robert

  4. #4
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    Files are only written in UNICODE if you specify that when you save it. Default is normal ASCII.

  5. #5
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Although, if you use Unicode characters, it will warn you to save it as Unicode if you don't.

    In Win2K, it's perfectly legal for .INI files to be either in ANSI or Unicode. Or even in a non-ANSI code page.

  6. #6
    Registered User
    Join Date
    Nov 2001
    Posts
    47

    Thumbs up

    Thanks a lot guys.
    It helped me much.

    Regards,
    Robert

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 01-28-2008, 02:07 AM
  2. Reading UNICODE into an edit
    By Ichmael™ in forum Windows Programming
    Replies: 3
    Last Post: 07-05-2005, 08:05 AM
  3. Should I go to unicode?
    By nickname_changed in forum C++ Programming
    Replies: 10
    Last Post: 10-13-2003, 11:37 AM
  4. Reading text in another app
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 03-12-2002, 08:45 AM
  5. Reading Unicode characters
    By Troll_King in forum Windows Programming
    Replies: 0
    Last Post: 10-18-2001, 12:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21