Character encoding gb2312

View: New views
2 Messages — Rating Filter:   Alert me  

Character encoding gb2312

by Michael Kay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A Chinese user of Saxon on .NET has reported a problem with character
encoding gb2312.

As far as I can see Saxon is simply calling

new OutputStreamWriter(System.err)

and this fails with the message

Encoding: gb2312 not found

The significant part of the stack trace is:


gnu.classpath.ServiceFactory.lookupProviders(Class spi) +0
java.nio.charset.Charset.providers2() +261
java.nio.charset.Charset.charsetForName(String ) +68
java.nio.charset.Charset.forName(String charsetName) +81
java.io.OutputStreamWriter..ctor(OutputStream out) +237


This is with Saxon 9.0, which is still using IKVM 0.32.0.0.

I can understand that gb2312 might not be available, but if it isn't
available then why has OutputStreamWriter() decided to use it? Is there any
way of influencing it to choose something else?

Regards,

Michael Kay
http://www.saxonica.com/


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers

Re: Character encoding gb2312

by Jeroen Frijters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Michael Kay wrote:
> I can understand that gb2312 might not be available, but if it isn't
> available then why has OutputStreamWriter() decided to use it? Is there
> any way of influencing it to choose something else?

The file.encoding system property determines the default encoding and it is set based on the .NET default encoding, so that's why it can be a non-existing encoding (unfortunately it's not really possible to validate if an encoding is available that early in the library initialization process).

As a workaround you can explicitly set file.encoding in the app.config. See http://osdir.com/ml/java.ikvm.devel/2005-03/msg00049.html for more info.

Regards,
Jeroen


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Ikvm-developers mailing list
Ikvm-developers@...
https://lists.sourceforge.net/lists/listinfo/ikvm-developers
LightInTheBox - Buy quality products at wholesale price