Results 1 to 3 of 3

Thread: Utf8

  1. #1

    Utf8

    Hi Guys!

    I'm having some strange problems loading a Text File with Japanese Characters saved like UTF8.

    I need to load it to a stringlist and proccess it line by line.

    I have this simple code:

    Code:
        AStringList.LoadFromFile(AFileName);
        for AIndex := 0 to AStringList.Count - 1 do
        begin
            ALine := AStringList[AIndex];
            Proccess(ALine);
       end;
    This code works on Windows/Mac but does not works on iOS.

    What do you suggest? Do I realy have to save the txt file like UTF8 or do I need to use something else?

  2. #2
    You may want to take a look at FreePascal's UTF8 functions, maybe some of those could help you: http://wiki.freepascal.org/LCL_Unicode_Support
    Or this won't help you may need to use some Objective-Pascal or Objective-C classes specifically NSString, you could use [NSString stringFromUTF8String], but then you would need to use NSStrings or convert them back.
    May I ask why aren't using the usual string localization method (a *.strings file with localizable string in the form of "MyString" = "Something"; ) provided by Xcode? (Sure, you would need to use some Objective-Pascal or Objective-C for that as well)
    Freeze Development | Elysion Game Framework | Twitter: @Stoney_FD
    Check out my new book: Irrlicht 1.7.1 Realtime 3D Engine Beginner's Guide (It's C++ flavored though)

    Programmer: A device for converting coffein into software.

  3. #3
    Thanks for the help!

    Well... the problem really was not with my Strings, and it was something wrong with my Font Class. I don't know what was wrong and why it works on Windows/Mac and does not works on iOS, but it were not very optimized anyway and so I decided to abandon it!

    I changed it to ZenGL native font and now it works like a charm! =)

    Now I just saves the text file like UTF8 and I don't need to use nothing different when loading it.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •