on 04-21-2010 11:19 AM
Hi All,
I have a scenario where I am reading some string values from a properties file placed in java DC.
The values read from properties file are to be displayed in Web Dynpro application.
The string values contain some umlaut characters eg (ü,ä).
While displaying in web Dynpro application the umlaut characters are getting distorted.
Any pointers for the same?
Regards
Radhika Kuthiala
Hi Radhika,
You can use concept of java encoding.
Solution1> you can convert the property file in the encoded format, in the DC having the pr0perty file.
use this command in the command line:-->native2ascii -encoding utf8 file.txt file2.txt
Sol2> You can set the encoding details in the NWDS, pls refer the below link:-
http://vietunicode.sourceforge.net/howto/java/encoding.html
Sol3> you can read the file and save in the Strign format and use java package import java.nio.charset.;* and encode the string.
Hope thismay help you.
Deepak!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepak,
I have already made the settings in NWDS for UTF8.
Can you please elaborate on solution 1 and 3:
Solution1> you can convert the property file in the encoded format, in the DC having the pr0perty file.
use this command in the command line:-->native2ascii -encoding utf8 file.txt file2.txt
-
Are we renaming hte files after changing the format?
Solution3>* you can read the file and save in the Strign format and use java package import java.nio.charset.;* and encode the string.
byte[] utf8 = val1.getBytes("UTF-8");
String vala = new String(utf8, "UTF-8");
I have already tried this ways too.Is this what Solution 3 implements?
Regards
Radhika Kuthiala
Hi Radhika,
Solution1> you can convert the property file in the encoded format, in the DC having the pr0perty file.
use this command in the command line:-->native2ascii -encoding utf8 file.txt file2.txt
-
Are we renaming hte files after changing the format?
In one of my previous project we have property file with the french character so we got error, to avoid this we have manually transtaled the file and utilized in the application and used the command in dos promt:-
native2ascii -encoding utf8 source.txt destination.txt ,
here if you want to replace the existing file u have to give same name source and destination file. But we have created 2 seprate file. after translation you will something like Fre/uooch king of output.
Solution3> you can read the file and save in the Strign format and use java package import java.nio.charset.; and encode the string. ---
Pls refer the below link:-
http://mindprod.com/jgloss/encoding.html
Hope this may help you.
Deepak!!!
One easy solution i have found is to change NWDS encoding from UTF-8 to CP1252. When you do that, your french characters will become distorted in NWDS. Re-type the french characters from another source or copy paste from somewhere else so that they are not distorted anymore (like Français). Deploy the app and browser will show the french characters correctly.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.