×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    15

    How can I read CJK from contacts and output the CJK characters to a file.

    I am testing mobile extensions' contacts feature(Also QFile and QString feature). I wanted to read the contacts' fields and output to a file(using QFile and QTextStream).

    Because there are CJK characters in the contacts, so I got quite a lot of '?' when I viewed the output file using Y-Browser.

    Maybe solving following problem would be helpful to a final solution:
    1) What is symbian's native encoding(UTF-8?)
    2) Is QString Unicode encoding? When read into QString, do I need to transform the native bytes from contacts list to Unicode? When write to file, do I need to transform Unicode to native encoding?

    Thanks in advance,
    -Revv

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: How can I read CJK from contacts and output the CJK characters to a file.

    Hi,

    1) Symbian uses unicode (UCS2) natively.
    2) QString also uses unicode (UCS2) internally. What you write to a file depends entirely on the file format that you use. The application that reads the file needs to know how it has been written. Plain text files are not generally written in UCS2.

    So, what do you want to be able to read this file with? Perhaps you can write a simple Qt application that reads the files back. Also, printing CJK characters depends on the availability of fonts on the device.

    Hope that helps,

    Mark

  3. #3
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    286

    Re: How can I read CJK from contacts and output the CJK characters to a file.

    Mark, UCS2 is only half the truth.
    Symbian uses SCSU to strore string streams which might be causing ?? issues.
    Also UTF-8 is widely used in many places but is easy enough to detect when reading the file.
    Then there is endianness.. although in this case BOM is the same for Qt and Symbian strings.

    If you put QTextStream to autodetect the codec what codec do you get ?

    To check the basics, does your phone have the character set installed?

  4. #4
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: How can I read CJK from contacts and output the CJK characters to a file.

    Yes, sorry, I was only talking about descriptors from Symbian APIs. If you are using native Symbian file formats and streams and stores then that isn't necessarily true.

    Mark

Posting Permissions

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