You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Dmitry Terkel <te...@prosoft.ru> on 2000/12/01 21:06:41 UTC

encoding in Xerces 1.2.2

�Maybe it is better to add static method that adds desired encoding to
the encoding table instead of editing the source code for MIME2Java
every time?

Somthing like this:

package org.apache.xerces.readers;
...
class� MIME2Java
{
�...
public static void addEncoding(String mimeEncodingName, String
javaEncodingName)
��� {
������� s_enchash.put(mimeEncodingName.toUpperCase(),javaEncodingName);
�������
s_revhash.put(javaEncodingName.toUpperCase(),mimeEncodingName.toUpperCase());

��� }
...
}

Currently I added windows-1251 encoding but I suspect that I'l need to
repeat this operation with any new release of Xerces� :)

Dmitry Terkel
terkel@prosoft.ru

Re: encoding in Xerces 1.2.2

Posted by Andy Clark <an...@apache.org>.
Dmitry Terkel wrote:
> Maybe it is better to add static method that adds desired 
> encoding to the encoding table instead of editing the source 
> code for MIME2Java every time?

Funny you should mention this because this is what we did for
the encoding mappings in Xerces2. The new class is located in
the org.apache.xerces.util package and is called "EncodingMap".

There are static methods to allow you to add your own encoding
mappings. This will allow us to keep only standard IANA mappings
in the reference implementation but allow programs to add their
own, non-standard mappings such as "Windows-1252" -> "Cp1252".

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org