Jump to content

Java & Japanese question


Hector
 Share

Recommended Posts

I've decided to write myself my own flashcard program for Japanese, but I cannot figure out how to get the compiler to recognize Japanese characters. I've tried switching the character encoding to Cp930 (all I could find that is supposed to work) but that makes the rest of my code cease working. I've only been trying to get the Japanese to work with println functions so far.

Anyways, I was wondering if there was anyone around here who knows how to do this sort of thing in Java--or if anyone knows how to do it in C++.

Thanks

Link to comment
Share on other sites

I've decided to write myself my own flashcard program for Japanese, but I cannot figure out how to get the compiler to recognize Japanese characters. I've tried switching the character encoding to Cp930 (all I could find that is supposed to work) but that makes the rest of my code cease working. I've only been trying to get the Japanese to work with println functions so far.

Anyways, I was wondering if there was anyone around here who knows how to do this sort of thing in Java--or if anyone knows how to do it in C++.

Thanks

Externalize strings into .Properties files, Unicode format text files. Read them in as UTF-8. Might need to do this hack: http://www.thoughtsabout.net/blog/archives/000044.html.

You definitely want UTF-8, as that will allow for most any charset, incl. Japanese/Chinese.

Also, FYI: http://jlanguagelearn.com/

this isn't really a direct answer to your question, but this sort of thing would probably be easier as a web app.. like something in PHP or javascript or somethin. you could just have a text file as a "database" and parse it as a space delimited text array, and the browser would take care of displaying the characters

Yes and no, for all sorts of reasons... PHP is actually not as Unicode-friendly as you'd think, there are separate methods/stuff you need to do, persisting to a text file can get ugly, doing things like timers and basic display stuff might be easier in Swing/AWT depending on what he's got in mind. I'd really hesitate to always recommend the web-based route, especially for what amounts to a personal, desktop-oriented business case.

Link to comment
Share on other sites

I've decided to write myself my own flashcard program for Japanese, but I cannot figure out how to get the compiler to recognize Japanese characters. I've tried switching the character encoding to Cp930 (all I could find that is supposed to work) but that makes the rest of my code cease working. I've only been trying to get the Japanese to work with println functions so far.

Anyways, I was wondering if there was anyone around here who knows how to do this sort of thing in Java--or if anyone knows how to do it in C++.

Thanks

If you are running this without a gui, you have to let the RTE know what encoding to use, the switch should be something like '-Dfile.encoding=UTF8'.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...