×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Apr 2008
    Location
    Bangalore (INDIA)
    Posts
    25

    warning: unmappable character for encoding Cp1252

    Hi all,
    I am getting following error "warning: unmappable character for encoding Cp1252" when i try to compile the source code,which is in japanese characters.

    ƒ\�[ƒg‚È‚µ is the japanese string, we are not able to trace it. and getting the " warning: unmappable character for encoding Cp1252" and we not able to compile the code.

    Can any one help me to come out of this????

    Regards,
    mutturaj

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: warning: unmappable character for encoding Cp1252

    This is why I tell people never to use non-ASCII characters in Java source code!

    You need to use the same character encoding that the source was originally compiled with. If you don't have access to the original developers, try:

    Code:
    javac -encoding MS932 <options> <source files>
    I'd recommend you find any bytes in the source code, not in the range 0-127, and remove or replace them. They are probably comments, in which case, just remove them.

    Cheers,
    Graham.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Location
    Bangalore (INDIA)
    Posts
    25

    Re: warning: unmappable character for encoding Cp1252

    Hi Graham,

    I used the following command javac -encoding MS932 <options> <source files>,
    but after converting the string appearance changed to "\[g",
    if we remove "\" from the string we can compile the code,but we get un readable
    menu options.
    Suppose i get in contact with the original developers,what i need to tell them to do ??
    i mean to say in which format they need to convert the code??

    Thanks,
    mutturaj

  4. #4
    Registered User
    Join Date
    Aug 2006
    Posts
    2

    Re: warning: unmappable character for encoding Cp1252

    change the IDE encoding format to UTF-8

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: warning: unmappable character for encoding Cp1252

    A source code file is a stream of bytes. When bytes are converted to characters, some scheme is used to determine what character each byte's value represents.

    By default, the compiler uses the "platform default encoding". Which is your problem, because this is different on different systems. On your computer, the default seems to be Cp1252 (a Microsoft standard, used by Windows in North America and Western Europe).

    This causes problems, when code is worked on by teams in different countries. For example, sometimes I have worked with developers in Russian-speaking countries. In Russia, Windows uses Cp1251 (Windows Cyrillic). In '1252, the byte 0xe9 represents the character "é" (lowercase latin e-acute). But '1251, 0xe9 is "й" (lowercase cyrillic short-i).

    So, you have two options.

    1. Find out what encoding the files were saved with. The developers might know this, but possibly not. The default encoding can be found by:

    Code:
    String encodingName = System.getProperty("file.encoding");
    2. Get them to save the files again, forcing the encoding to something like (as the ealier poster suggests) UTF-8.

    Either way, you must choose the same encoding in your IDE/compiler.

    Beware that, if there is Japanese text in the product, it might not show on your device, if your device is not a Japanese model.

    Cheers,
    Graham.

  6. #6
    Registered User
    Join Date
    Apr 2008
    Location
    Bangalore (INDIA)
    Posts
    25

    Re: warning: unmappable character for encoding Cp1252

    Hi Graham,
    Thanks for the detailed reply..
    I reported to it to the original developers.

    Thanks,
    Mutturaj

  7. #7
    Registered User
    Join Date
    Apr 2008
    Location
    Bangalore (INDIA)
    Posts
    25

    Re: warning: unmappable character for encoding Cp1252

    Hi graham,
    My problem solved...
    Original developers converted encoding to utf-8 format,
    application is compiling successfully,and i used google language tools,
    to convert the string from japanese to english.

    Thanks,
    mutturaj

Similar Threads

  1. linking error
    By dakosurf in forum Symbian
    Replies: 1
    Last Post: 2008-03-27, 22:45
  2. linking error
    By dakosurf in forum Open C/C++
    Replies: 0
    Last Post: 2008-03-27, 09:20
  3. Errors compilling and debugging Helloworld
    By doberlet in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2004-03-04, 18:08
  4. Codewarrior import .mmp error
    By serenade in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2004-02-21, 20:06

Posting Permissions

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