This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
UnsupportedEncodingException
- From: Melanie <melanie_j_j at yahoo dot com>
- To: java at gcc dot gnu dot org
- Date: Wed, 29 Sep 2004 06:03:06 +0100 (BST)
- Subject: UnsupportedEncodingException
Hello, am having lots of trouble compiling code as the
following, using a GCJ build for windows from
http://www.thisiscool.com/gcc_mingw.htm, the 3.4
version:
...
PrintWriter writer = new PrintWriter(new
OutputStreamWriter(new FileOutputStream("test.txt"),
"UTF-8"));
?writer.write("testing");
?writer.close();
...
I keep getting a java.io.UnsupportedEncodingException
for UTF-8! I googled a bit and found a solution by
declaring a Class ref to
gnu.gcj.convert.Output_UTF8.class as described here
for example,
http://www.xwt.org/javasrc/org/xwt/plat/GCJ_java.html
and here:
http://gcc.gnu.org/ml/java/2004-03/msg00289.html. I
tried the code on linux with GCJ and it worked fine
without the Class ref.
?
How can i used other encodings? especially
windows-1256 or Cp1256? I tried code using
'windows-1256' under linux and and it worked correctly
without any class references.
?
Any ideas on how to use such an encoding using GCJ
with windows? What class should i reference. As i
understand this is to force the linker to link to a
required library. Any help?
I also tired using GCJ by downloading packages from
mingw here: http://prdownloads.sourceforge.net/mingw/
and it didnt work as well. I couldnt use windows-1256
as i could in linux. I tried with Slackware, FC2, and
mandrake.
Could someone please shed some light on this?encoding
issue. Thanks.
Melanie Parker
________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html