×

Discussion Board

Results 1 to 11 of 11

Hybrid View

  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    17

    Exclamation Unable to read Chinese resource file S40 SDK 2

    My app is translated into 9 national languages: English, French, Spanish, Portuguese, Italian, Chinese, Hindi, Russian, & Arabic.

    However, I've hit a really odd problem on S40 SDK 2. It cannot read the Chinese resource file - end of file is reached when attempting to read the first byte!

    All nine resource files can be read in S40 E3 & E6 and S60 emulators. The same behaviour is found on actual devices (I have used exactly the same build (JAD/JAR) on each emulator and device).

    The following resource file snippets are in English and Chinese respectively:

    1000=HTTP authorisation failed
    1010=Bad HTTP request
    1020=Customer information failed
    1030=Delivery limit exceeded
    1040=Error in connecting to drm server

    1000=HTTP授权失败
    1010=错误的HTTP请求
    1020=客户信息失败
    1030=交付超出限制
    1040=连接drm服务器时出错

    I have worked around the problem by loading the English resource file if no keys are loaded into the hash map, but I think this is a platform bug.
    Last edited by javadude; 2012-10-23 at 09:59. Reason: Corrected emulator edition

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,545

    Re: Unable to read Chinese resource file S40 SDK 2

    What's the encoding format used in the Chinese file?

  3. #3
    Registered User
    Join Date
    Jan 2011
    Posts
    17

    Re: Unable to read Chinese resource file S40 SDK 2

    All resource files are in UTF-8.

    [Apologies for the slow response - I just found the alert email in my junk folder ]

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2003
    Posts
    4,105

    Re: Unable to read Chinese resource file S40 SDK 2

    How do you read those files? this.getClass().getResourceAsStream and then ByteArrayInputStream or InputStreamReader?

  5. #5
    Registered User
    Join Date
    Jan 2011
    Posts
    17

    Re: Unable to read Chinese resource file S40 SDK 2

    I create a reader from an input stream:

    InputStream stream = System.class.getResourceAsStream(path);
    Reader reader = new InputStreamReader(stream, encoding);

  6. #6
    Nokia Developer Champion
    Join Date
    Mar 2003
    Posts
    4,105

    Re: Unable to read Chinese resource file S40 SDK 2

    Try to break it down and debug it with ByteArrayInputStream and ‘new String(line, "UTF-8")’. Perhaps a single char is the problem.

  7. #7
    Registered User
    Join Date
    Jan 2011
    Posts
    17

    Re: Unable to read Chinese resource file S40 SDK 2

    I did originally debug this and found that I get an end of file attempting to read the first byte!

    Given that it only occurs on S40 SDK 2 I think this is a platform bug.

    I have logged a bug with Nokia for this - Bug 1073 - Unable to read Chinese resource file S40 SDK 2 but no-one is paying any attention.

    The trouble is that the platform returns end of file. I can't see a work-around for this so it's my app look ends up looking bad.

Similar Threads

  1. Replies: 0
    Last Post: 2004-07-18, 17:12
  2. Resource file in Chinese
    By daoshan in forum Symbian
    Replies: 1
    Last Post: 2003-07-08, 10:02
  3. Compiling Chinese Resource File
    By daoshan in forum Symbian
    Replies: 5
    Last Post: 2003-07-08, 09:58
  4. Compile Chinese resource file
    By daoshan in forum Symbian
    Replies: 0
    Last Post: 2003-07-07, 16:24
  5. Read Chinese Text file and Display Chinese on Canvas Problem?
    By goeast in forum Mobile Java General
    Replies: 4
    Last Post: 2002-09-18, 03:28

Posting Permissions

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