Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to translate Japanese String into UTF-32 encoded using Java APIs ?

Reply
Thread Tools

How to translate Japanese String into UTF-32 encoded using Java APIs ?

 
 
Marat
Guest
Posts: n/a
 
      11-09-2004
Hello to all!

I have to encode some Japanese string typed in text edit box (all
characters are 3-byte characters) into UTF-32 and store in *.txt file
...

The following work arrounds throws exceptions :

OutputStreamWriter out = new OutputStreamWriter(new
ByteArrayOutputStream(),
"UTF-32");
out.write(value);
out.flush();

String tmp = out.toString();

OR

byte[] bytedValue = value.getBytes("UTF-32");
value = new String(bytedValue,"UTF-32");

Any ideas ?
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      11-09-2004
On 9 Nov 2004 12:56:20 -0800, Marat wrote:

> The following work arrounds throws exceptions :


Is that an InsufficientStrawberriesException? No?
Well perhaps you had better be more precise.
<http://www.physci.org/codes/javafaq.jsp#exact>

And, please do not repost your question, especially
after just 5 minutes.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
 
Reply With Quote
 
 
 
 
Marat
Guest
Posts: n/a
 
      11-10-2004
Hello Andrew!

It is really InsufficientOrangeException .. How did you know that ???
I suppose you are farmer with a huge experience in fruit collecting
So I guess you do not even know what is UnsupportedEncodingException ..

No comments ...

Reposting is caused by timeout session , btw ...




Andrew Thompson <(E-Mail Removed)> wrote in message news:<ajm9vqcn6xxy$(E-Mail Removed)>.. .
> On 9 Nov 2004 12:56:20 -0800, Marat wrote:
>
> > The following work arrounds throws exceptions :

>
> Is that an InsufficientStrawberriesException? No?
> Well perhaps you had better be more precise.
> <http://www.physci.org/codes/javafaq.jsp#exact>
>
> And, please do not repost your question, especially
> after just 5 minutes.

 
Reply With Quote
 
Michael Borgwardt
Guest
Posts: n/a
 
      11-10-2004
Marat wrote:
> It is really InsufficientOrangeException .. How did you know that ???
> I suppose you are farmer with a huge experience in fruit collecting
> So I guess you do not even know what is UnsupportedEncodingException ..


The name alone says it all, doesn't it? The encoding UTF-32 is not supported
by your JVM. That's no big surprise since it is not one of the required
encodings and Java doesn't support characters outside of UCS-2 anyway.
Why don't you use UTF-16?

 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      11-10-2004
On 10 Nov 2004 06:33:43 -0800, Marat wrote:

> Hello Andrew!


Hello Marat. Please don't top-post, I find it most confusing..
<http://www.physci.org/codes/javafaq.jsp#netiquette>

> Andrew Thompson <(E-Mail Removed)> wrote in message news:<ajm9vqcn6xxy$(E-Mail Removed)>.. .
>> On 9 Nov 2004 12:56:20 -0800, Marat wrote:
>>
>>> The following work arrounds throws exceptions :

>>
>> Is that an InsufficientStrawberriesException? No?
>> Well perhaps you had better be more precise.
>> <http://www.physci.org/codes/javafaq.jsp#exact>

....
> It is really InsufficientOrangeException .. How did you know that ???
> I suppose you are farmer with a huge experience in fruit collecting


No, merely a consumer with a sweet tooth.

> So I guess ..


Stop guessing, you're not especially good at it.

>..you do not even know what is UnsupportedEncodingException ..


It is an exception caused when you attempt to use an encoding
which is not supported (such as "klingon").

Sun is a bit 'secretive' about the supported encodings, but
a quick search led me here..
<http://java.sun.com/webservices/docs/1.2/tutorial/doc/Encodings.html#wp64107>
and here
<http://java.sun.com/j2se/1.5.0/docs/guide/intl/locale.doc.html#jfc-table>

Hunt around, but as far as I could see, no metnion of UTF-32.

> No comments ...


??

> Reposting is caused by timeout session


timeout session? That's a new one on me.

>.., btw ...


...good, good. No 'sorry about wasting the bandwidth' then?

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
 
Reply With Quote
 
John C. Bollinger
Guest
Posts: n/a
 
      11-10-2004
Andrew Thompson wrote:

> Is that an InsufficientStrawberriesException?


Ooh, I _hate_ those!


John Bollinger
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: DBMS versus XML APIs (was "any (preferably open source) staticanalysis tool or methodologies/studies to translate ANSI [C|C++] or javacode to XML?") Joe Kesselman XML 0 09-27-2011 12:52 PM
Changing raw text to unicode format using Standard Java APIs theAndroidGuy Java 6 05-01-2009 08:30 AM
Importing Hotmail Addressbook from Java Client using commons-httpclient APIs Gamas Java 0 02-04-2005 11:50 PM
1Ds Mk II - who can translate Japanese? Brian C. Baird Digital Photography 7 09-21-2004 03:40 PM
UML and APIs using Java interfaces Calum MacLean Java 3 07-03-2003 03:42 PM



Advertisments