Japanese, Question Marks, Locales, Eclipse, and Windows XP ????

Hello. I am having some issues localizing JSP to Japanese. I have read a lot of stuff on the topic. I have my .properties file in unicode with native2ascii, etc.
When I debug under Eclipse 3.0, I see the Japanese characters correctly displayed in my properties file and inside of strings internal to to the program. However, when I try to print them with a System.out.println, I get question marks (??????).
My reading tells me that the ???? indicate that the characters cannot be displayed. I am somewhat confused because in the same Eclipse context I can clearly see the Japanese characters in the debugging window.
Thus I am missing the part where I set my standard output to correctly display the characters like Eclipse is displaying them in windows other than the "Console" window.
My default encoding is CP1252. If I do something like:
out = new java.io.PrintStream(System.out, true, "UTF-8");
and print my unicoded resource from the bundle I get the UTF-8 character representation (��������������������������������������������). With System.out.println I get ?????
My first reaction would be that the Japanese fonts aren't on my system, but clearly they are as I can see them in other windows.
When I try to show a Japanese resource on the web page that is the result of the jsp file I get ????. I can display the same characters UTF-8 encoded in a php page.
Here is another example:
java.util.Locale[] locales = { new java.util.Locale("en", "US"), new java.util.Locale("ja","JP"), new java.util.Locale("es", "ES"),
new java.util.Locale("it", "IT") };
for (int x=0; x< locales.length; ++x) {
String displayLanguage = locales[x].getDisplayLanguage(locales[x]);
System.out.println(locales[x].toString() + ": " + displayLanguage);
displays:
en_US: English
ja_JP: ???
es_ES: espa�ol
it_IT: italiano
instead of the correct Japanese characters.
What's the secret?
Thanks.
-- Gary

What do you want to do exactly? 1. Making a window application? 2. Making a console application? 3. Making a JSP webpage?
1. If it's window application, there's nothing to worry about if you use Swing. But if you use AWT, it's time to switch to Swing.
2. If you're making console application, solution does exist as others had pointed out but you'd better forget it because no console in whatever platform supports Unicode (Linux xterm may be an exception? But it probably has font problem). So, even if you could display characters in your computer, the solution isn't universal. You can't ask your every user to switch system locale, install whatever font in order to display a few characters!!
3. If you're making JSP, I'd advise you to use UTF-8 in webpages. Most browsers nowadays (probably more than 90%) could support UTF-8. All you need is to add the following JSP headers to your every page:
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page pageEncoding="iso-8859-1" %>Now, your every out.println(s); will send the correct data to browser without the least effort from you. All conversions are automatic!
However, just to make things even surer, you could add this HTML meta header:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">You use Tomcat, right? I do, and I don't have any problem.
Last words:
But, if all you want to do with System.out.println is for debugging, you could use
JOptionPane.showMessageDialog(null, "your string here");But you'd better have Java 5, or at least 1.4.2, if you want to have everything displayed correctly.

Similar Messages

  • Launch pad has question mark in icon and won't launch

    Hello,
    On my intel mac with lion the icon for launch pad has a question mark over it and wont launch. Also when I hit f4 it wont start launch pad. Any help would be appreciated.

    Somehow you've managed to delete it.
    To re-install iPhoto
    1. Put the iPhoto.app in the trash (Drag it from your Applications Folder to the trash)
    2. Download it from the App Store to reinstall It's on your Purchases List* there.
    For older versions that have been installed from Disk you'll need these additional steps:
    2a: On 10.5:  Go to HD/Library/Receipts and remove any pkg file there with iPhoto in the name.
    2b: On 10.6: Those receipts may be found as follows:  In the Finder use the Go menu and select Go To Folder. In the resulting window type
    /var/db/receipts/
    2c: on 10.7 or later they're at
    /private/var/db/receipts
    A Finder Window will open at that location and you can remove the iPhoto pkg files.
    3. Re-install.
    If you purchased an iLife Disk, then iPhoto is on it.
    If iPhoto was installed on your Mac when you go it then it’s on the System Restore disks that came with your Mac. Insert the first one and opt to ‘Install Bundled Applications Only.
    *Sometimes iPhoto is not visible on the Purchases List. it may be hidden. See this article for details on how to unhide it.
    http://support.apple.com/kb/HT4928
    One question often asked: Will I lose my Photos if I reinstall?
    iPhoto the application and the iPhoto Library are two different parts of the iPhoto programme. So, reinstalling the app should not affect the Library. BUT you should always have a back up before doing this kind of work. Always.

  • Why do I have question marks in the finder window header?

    Ever since I upgraded my MacBook Pro to Lion I've noticed a large question mark in the finder window header. There is a smaller one beneath it, and they're both located just to the left of the search window.

    Can you do a screenshot please?
    Also may just grag and drop them outside the finder window.

  • Why is there a question mark in the Finder window?

    Why is there a question mark in the finder window that looks like this.     When I click the question mark in displays this message.                                                                                                                                  

    Because the item there has been moved from its original location or deleted (there's none in that location by default), or something made the Finder think there was an item there. In either case, the question mark can be removed by control-clicking it and choosing Remove Item, or by command-clicking it and dragging it out of the window.
    (66395)

  • Question mark in a finder window

    Hi there,
    recently, I noticed a weird question mark on any finder window I open:
    any idea what it is? someone?
    Thanks a lot!!

    It's a shortcut that you no longer have the original for - maybe a file you deleted or moved. Usually, it's nothing to worry about. You can remove the shortcut by holding down the command key and dragging it off the window.
    Matt

  • My system disk icon has a question mark in it and does not open now

    my system disk icon has a question mark in it and does not open now
    and my devices name is gone when i click on FINDER, my favourites is there with the following listed under it-
    ALL MY FILES
    AIRDROP
    APPLICATIONS
    DESKTOP
    DOCUMENTS and under documents was the DEVICES word with my Macintosh under it, this is missing... what have i done

    Somehow you've managed to delete it.
    To re-install iPhoto
    1. Put the iPhoto.app in the trash (Drag it from your Applications Folder to the trash)
    2. Download it from the App Store to reinstall It's on your Purchases List* there.
    For older versions that have been installed from Disk you'll need these additional steps:
    2a: On 10.5:  Go to HD/Library/Receipts and remove any pkg file there with iPhoto in the name.
    2b: On 10.6: Those receipts may be found as follows:  In the Finder use the Go menu and select Go To Folder. In the resulting window type
    /var/db/receipts/
    2c: on 10.7 or later they're at
    /private/var/db/receipts
    A Finder Window will open at that location and you can remove the iPhoto pkg files.
    3. Re-install.
    If you purchased an iLife Disk, then iPhoto is on it.
    If iPhoto was installed on your Mac when you go it then it’s on the System Restore disks that came with your Mac. Insert the first one and opt to ‘Install Bundled Applications Only.
    *Sometimes iPhoto is not visible on the Purchases List. it may be hidden. See this article for details on how to unhide it.
    http://support.apple.com/kb/HT4928
    One question often asked: Will I lose my Photos if I reinstall?
    iPhoto the application and the iPhoto Library are two different parts of the iPhoto programme. So, reinstalling the app should not affect the Library. BUT you should always have a back up before doing this kind of work. Always.

  • Why does my Logic Icon have a question mark over it and will not boot up??

    Why does my Logic Icon have a question mark over it and will not boot up??

    Because it was moved, renamed, or deleted, and needs to be put back or reinstalled.
    (107320)

  • The application folder has a question mark on it and it will not open?

    the application folder has a question mark on it and it will not open?

    Redownload and reinstall it.
    (58504)

  • My music has a question mark on it and wont play

    my music has a question mark on it and wont play in itunes anymore.

    Which version of OSX and which version of Word?

  • I am resurrecting my old iMacG5 for my grandson. Appleworks has question mark in dock and does not load from bundled software on original installation discs. Can anyone help?

    I am resurrecting my old iMacG5 for my grandson. Appleworks has question mark in dock and does not load from bundled software on original installation discs. Can anyone help?

    I'm sorry no-one has answered you yet - I'm afraid I don't know the answer to the question: but I wanted to put into your mind that starting up with AppleWorks at this stage isn't a good idea. The program was 'end-of-lifed' years ago, it won't run on Lion, and some of the document types created in it - Databases in particular - cannot be opened at all by any other program whatever. Word Processing documents can be opened in Pages, and Spreadsheets in Numbers (with some reservations in both cases), but building up a collection of AppleWorks documents at this stage is going to lead to problems later on.
    It's difficult to know what to recommend for a PowerPC machine that would still be compatible with modern ones. An older version of Microsoft Office, perhaps, if you can find one which will run on PPC; but most of the modern Word Processors are Intel only. This is something you would need to investigate.

  • Firefox application has a question mark over it and I can't open it. ?

    Firefox application has a question mark over it and I can't open it now.  Just got rid of the MacGuard virus.  ? 

    Redownload and reinstall it.
    (58504)

  • When i make internet recovery i see question mark after install and reboot. Why?

    When i make internet recovery on clear HDD's with created striped software RIDE 0 with two HDD in mac mini.
    I see question mark after install and reboot. Why?

    Make a "Genius" appointment at an Apple Store to have the machine tested. Back up all data before you go.

  • I got a question regarding running iOs and Windows using virtual software.

    Greetings!
    I got a question regarding running iOs and Windows using virtual software. I recently bought a monitor so I can display Windows on it and run both OS at the same time.Now,I'm using BootCamp. I downloaded VirtualBox for "tranferring" Windows on it. Since I'm a new iOs user , what do I need to do in order to make work?
    Do I need to un-install Windows from BootCamp,install VirtualBox and then install them again?
    Any information would be appreciate it!

    That should work to use OS X, you can run MS Windows using Virtual Box and use a seperate display for the Virtual Box window. That way you can run OS X and MS Windows simultaneously. However remember Virtual Box is freeware and not a commercial application like Parallels or VMWare Fusion and may not have the features of a commercial application. Support for Windows run in any virtualization application (Virtual Box, Parallels or Fusion) is not generally done on this forum as they are not OS X related. To get help on those apps you usually will need to go to their forums.
    Remember IOS will not run on either OS X or MS Windows, it only works on IOS devices.
    Good luck with your installation.

  • Hi, I have an iMac which I just booted up and have a white screen with a blue folder with a question mark blinking on and off. Any help would be appreciated. Tommy

    Hi, I have an iMac which I just booted up and have a white screen with a blue folder with a question mark blinking on and off. Any help would be appreciated. Tommy

    That means your iMac could not find a system to use for startup.  That may mean the internal hard drive has become faulty, or the hard drive mechanism is fine, but the startup volume ("Macintosh HD" unless you renamed it) may have some type of data corruption that makes it unbootable.
    First, you should try resetting PRAM
    http://support.apple.com/kb/HT1379
    and if that does not help, use this procedure to reset SMC (power management).  If your iMac is from 2008, this is the procedure for Intel (not PowerPC) Macs.
    http://support.apple.com/kb/HT3964
    (This forum category is for "iMac (PPC)," so if this iMac is older (with a PowerPC processor), please post back.)
    Disconnect all peripheral devices.  When you connect it back to power, if you have been using a power strip of some type, try connecting it directly to a wall outlet, by itself (at least initially).  Start up with nothing but the power cord connected, then add only standard mouse and keyboard.  If it works, run it that way for a while. 
    If PRAM and SMC reset have no effect, you should insert your Mac OS X installation disc (for the currently installed system) in the optical drive, and restart with the C key held down.  This should get you to the Installer screen, where you can run Disk Utility from the Utilities menu. 
    In Disk Utility, does the internal hard drive appear in the sidebar?  If so, select Macintosh HD in the sidebar and go to the First Aid tab.  Use Repair Disk.  If an error is found, note if Disk Utility was able to fix it or not.
    You can then quit Disk Utility and attempt to restart normally.

  • Unicode characters are shown as "question marks" in Eclipse console

    I am trying to retrieve Unicode data from Sybase database using jdbc.
    The data are stored in Sybase with unichar and univarchar datatypes.
    Following is the java code tring to run.
    {color:#808080}public class Test
    public static void main(String [] args) throws Exception
    CoreServiceSoapBindingStub binding_Core = new CoreServiceSoapBindingStub();
    CoreWSServiceLocator locator_Core = new CoreWSServiceLocator();
    binding_Core = (CoreServiceSoapBindingStub) locator_Core.getCoreService();
    Contact[] con = binding_Core.getContact();
    for(int i=0;i< con.length;++i)
    System.out.println(con.getLastName());
    }{color}
    The result of this code in Eclipse console should be as follow (consists of one English and one Japanese name).
    {color:#808080}Suzuki
    &#37428;&#26408;{color}
    However when I run this, I get the following.
    {color:#808080}Suzuki
    {color}
    The alphabetical characters seem to diplay fine in the console, but foreign characters are not....
    The default character set of the database is ISO-8859-1, but I used unichar and univarchar to store data in unicode thus believe no issue at database side...
    Used jconnect 6.05 (com.sybase.jdbc3.jdbc.SybDriver
    ) for the database driver.
    Java files are encoded in UTF-8.
    Console Encoding is UTF-8.
    Is this an issue in database driver?
    Since I set the parameters for character set to UTF-8 in both the database and java files....
    It would be great if someone could give some comments on this issue....
    Thanks a lot.

    It might be better to ask this question on an Eclipse forum. I have a couple of suggestions, but none of them have made the output in my console look entirely correct:
    1. Try to start Eclipse with these parameters: -vmargs -Dfile.encoding=UTF-8
    2. Try switching the font settings for the Console under Preferences in Eclipse.

Maybe you are looking for

  • Charging my ipod in India with Apple's World Travel Adapter kit?

    I am going to India. I would like to take my ipod mini. I have the USB Power Adapter. Does the Apple World Travel Adapter Kit have a plug that will work in India? Thanks.

  • Issue on table control

    In my modulepool program , i am unble to add new item in table control. in this program when add item first time , it is working fine . but when update  mode , it is not adding. please help on this. Moderator Message: Put a little more effort into fr

  • What connector cable is used to send photos from iPhone to macbook pro?

    What cable is needed to send iphone fotos to macbook pro? The cable I use for my Canon camera doesn't fit my laptop.

  • Physical path problem

    Hi, In my struts application , I'm using the properties file , which is placed now in C drive . I need to keep that file in my application folder ,but don't know as how to specify the path . My java files path is C:\app-name\src\src-web\java . My cod

  • Re: Recovery disc creator cannot be launched

    Hi, I'm having problem with my recovery disc creator, an error occured "No HDD recovery area!\nThe recovery disc can not be launched." when i'm trying to create a back-up disc. Need help. What do i need to do? Many thanks. kenji Solved! Go to Solutio