From: George R. <gr...@us...> - 2005-06-16 17:00:42
|
I presume that you're printing to the command prompt, and I presume that=20 you're not running on a Japanese machine. You have a codepage conversion=20 problem. Instead of writing to the command prompt, try writing it to a file as=20 UTF-8, and opening it with notepad or your web browser. or If you're on Windows, try following this tip by making the command prompt=20 use UTF-8 http://sourceforge.net/mailarchive/message.php?msg=5Fid=3D1095087= 6=20 (I don't know if it will work for Java though) or If you're on a Unix machine, make sure that your locale and your terminal=20 are set to UTF-8. George Rhoten IBM Globalization Center of Competency/ICU San Jos=E9, CA, USA http://www.icu-project.org/ http://icu.sourceforge.net/ Olivier Schmeltzer <olivier=5Fs...@ya...>=20 Sent by: icu...@li... 06/16/2005 07:40 AM Please respond to icu-support To icu...@li... cc Subject [icu-support] Implementing the LocaleExplorer demo Hello everyone, Sorry if this question is stupid and/or has already been answered (I did a quick search in the archive but did not find an answer). I would like to print dates in the japanese locale (for instance), exactly in the same way the LocaleExplorer demo does (http://www-950.ibm.com/software/globalization/icu/demo/locales http://www-950.ibm.com/software/globalization/icu/demo/locales/?d=5F=3Den&= =5F=3Dja ) but I am having no success at it... I tried the following Java code but I get '?' instead of the month (and I am rather sure that I get all the fonts right). Can somebody help me ? Is the LocaleExplorer demo code available ? (in Java would be great !). I also took a look at the source code, which contains demos and examples, but could not find anything interesting for my need. Thanks in advance. Olivier package test; import com.ibm.icu.text.SimpleDateFormat; import com.ibm.icu.text.DateFormat; import com.ibm.icu.util.Calendar; import com.ibm.icu.util.ULocale; public class DateFormatTest { public static void main(String[] args) { =20 ULocale uloc =3D ULocale.JAPAN; System.out.println(loc); SimpleDateFormat formatter =3D new SimpleDateFormat("MMMM yyyy", loc); Calendar date =3D Calendar.getInstance(); date.set(Calendar.YEAR, 1989); date.set(Calendar.DATE, 1); date.set(Calendar.MONTH, 2); =20 System.out.println("\t"+formatter.format(date.getTime())); =20 } } the result is : ja=5FJP 3? 1989 =20 =20 =20 =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =20 Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger = T=E9l=E9chargez cette version sur http://fr.messenger.yahoo.com ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad=5Fid=3D7477&alloc=5Fid=3D16492&op=3Dcl= ick =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F icu-support mailing list - icu...@li... To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support |