Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Problems With Japanese Text

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm currently writing a flash card program to help with studying Japanese. The program works fine on machines where the Language for non-Unicode programs is set to Japanese in Regional and Language Options. The problem is that setting this to Japanese has an effect on multi-language programs and can unwanted effects such as programs installing or displaying in Japanese. It also reduces the portability of my app and as a flash card program I'd like it to be usable on any PC.

If the language is not set to Japanese, a few things go wrong. First, displaying of the Japanese text I have read in now displays garbage. I was thinking of attempting to store a Japanese font in my project and trying to use that, but I wasn't sure if that's the right way to go about it, or if it would even work. The other problem is that after my program writes all the garbage back to another file, the Japanese text becomes unrecoverable.

Below is the code I use for reading and writing the files. The WordEntry class just stores the Japanese text in a string and the Japanese text is displayed in a JTextArea.

 
Michael Cuoco
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it to work. I just had to change my input and output to UTF-8 and make sure to save my files in Unicode.


 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic