This discussion is archived
2 Replies Latest reply: Jul 22, 2010 2:01 AM by 843810 RSS

Character-encoding problem (Czech)

843810 Newbie
Currently Being Moderated
Hi all,

We are working on giving support to Czech language in some modules in our application and we are getting problems. We need to add Czech text in some keys inside file.properties for English language.

We have used the native2ascii tool to convert property file from UTF-8:
native2ascci -encoding UTF-8 spa_en_utf8.properties spa_en_properties
When we run the application it display the most of characters correct, but some characters like č or ů we get only questionmarks (??).

We are using java 1.4 - SunOS 5.9 – Weblogic 8.1 and we set the default encoding
file.encoding = ISO8859-1.

Any idea about what we are doing wrong? Thanks in advance.
  • 1. Re: Character-encoding problem (Czech)
    DrClap Expert
    Currently Being Moderated
    When your application displays the data from the properties file, it displays question marks instead of characters which aren't in Latin-1? Then either there are question marks in the properties file (which you could easily verify) or the application is doing something wrong with encodings.
  • 2. Re: Character-encoding problem (Czech)
    843810 Newbie
    Currently Being Moderated
    Yes, that's right. The key contains unicode, for example:
    V\u00e1\u017een\u00fd
    But when we run the application it displays Vá?ený instead of Vážený.

    This method get access to the message resources:
    public static String getMensaje(Locale locale, String bundle, String clave) {
       String msg = null;
    
       MessageResources messages = MessageResources.getMessageResources(bundle);
       msg = messages.getMessage(locale, clave);
    
       return msg;
    }
    We try for set encoding UTF-8 for properties file and then everything works fine. Is this wrong?
    Thanks.