This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]