Jack Wang wrote:
>
> Sorry, it is off the topic.
> The following code, out.println("<br>createUnicodeString=") show
> \u53D1\u738B123, and out.println("<br>unicode=""\u53D1\u738B123") show the
> chinese character code, Why ? In fact, that should be the same, but here one
> is I18n, another is /uxxxx.
I think you should not put strings into your code. You
should use it this way:
This is the simplest application code:
---------------------------------------------------------
import java.util.*;
import java.text.*;
public class MyApp {
static public void main(String[] args) {
//Locale mylocale = new Locale("cs","CZ");
Locale deflocale = Locale.getDefault();
ResourceBundle texts =
ResourceBundle.getBundle("Texts",deflocale);
System.out.println(texts.getString("t_id"));
}
}
----------------------------------------------------------
Then create a file named "Texts.txt" containing definition
of strings:
------------------------------------------
t_id=<Your chinese characters in GB2312>
------------------------------------------
Then convert it to "Texts.properties" file with this command:
native2ascii -encoding GB2312 Texts.txt Texts.properties
Then you can run your application with properly set locale
(LC_ALL variable on Unix, Regional settings on WindowsNT)
which causes proper setting of "file.encoding" property.
Hope this helps
Martin
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INET, a.s. Mgr. Martin Kuba
Kralovopolska 139 e-mail: [EMAIL PROTECTED]
601 12 Brno WWW: http://www.inet.cz/~makub/
Czech Republic tel: +420-5-41242414/33
--------------------------------------------------------------------
PGP fingerprint = D8 57 47 E5 36 D2 C1 A1 C3 48 B2 59 00 58 42 27
http://wwwkeys.cz.pgp.net:11371/pks/lookup?op=index&search=makub
--------------------------------------------------------------------
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html