Re: How to read unicode
- From: Chris Smith <cdsmith@xxxxxxx>
- Date: Wed, 4 Jul 2007 13:54:01 -0600
JR <jriker1@xxxxxxxxx> wrote:
I have a java program that parses text files of metadata and does
various activities on it. I recently was asked to start working with
Japanese Unicode characters but not sure where to begin if I need ot
do anything specific for this. This program runs in a DOS window on a
Western character set PC. Some questions that come to mind that I was
hoping to get input on:
1. Would it just work as is if I was running in a DOS window on a
Japanese version of Windows XP?
There are two ways to approach I/O. One is to use the system default
character encoding. The other is to specify a character encoding. If
you've used the system default character encoding, then it would
probably work on a Japanese system with Japanese characters. If you've
specified an encoding, then it probably won't.
You should always prefer specifying an encoding when possible. However,
the encoding you use has to match the encoding of the "metadata text
files" you are reading. If you can't control those, then your choice is
made for you. You need to find out from whomever writes these files
what encoding they use.
2. If in US, do I have to convert the characters from their graphical
representation to their Unicode numeric equivalent?
You can't draw characters to the console that aren't in the character
set for that console. So you'll either need to convert your code to a
GUI, or give up on drawing Japanese characters on a non-Japanese
terminal.
3. If so is there some way to parse the source data and convert it
from like MS Mincho to Unicode?
I don't know what MS Mincho is. Sorry.
4.Can I save this data if converted as a standard text file?
Sure you can save it. Again, you can save it either in a specific
encoding, or with the platform default. If the text contains characters
that can't be encoded with that encoding, they will appear as '?'
characters.
--
Chris Smith
.
- Follow-Ups:
- Re: How to read unicode
- From: Oliver Wong
- Re: How to read unicode
- References:
- How to read unicode
- From: JR
- How to read unicode
- Prev by Date: Re: Java 7 features
- Next by Date: Re: Class loading and the new keyword.
- Previous by thread: Re: How to read unicode
- Next by thread: Re: How to read unicode
- Index(es):
Relevant Pages
|
Loading