olegabr wrote:
> 
> I've done it and encoding==cp1251
> but it is not supported by xerces
> 
> question: how can I convert my files in one of encodings
> that is already supported?

For these thing I use iconv:
+++
iconv -f cp1251 -t 8859_1 toto.xml
+++

There also a native2ascii in most JVM distribution.

The last trick is to add the support in xerces:
Find below a patch I have used.
+++++++++++
--- ../tmpo/xerces-1_2_1/src/org/apache/xerces/readers/MIME2Java.java  
Fri Oct 20 00:23:04
2000                                                                
+++ src/org/apache/xerces/readers/MIME2Java.java        Thu Nov 16
11:21:18 2000
                                                                                
@@ -558,6 +558,9
@@                                                             
                                                                                
                                                 // j:CNS11643 ->
EUC-TW?       
                                                 // ISO-2022-CN?
ISO-2022-CN-EXT?                                                                
               
+       //
JFC                                                                  
+        s_enchash.put("OSD_EBCDIC_DF04_1",
"OSD_EBCDIC_DF04_1");               
+        s_enchash.put("ISO-8859-15",     
"8859_15");                          
                                                                                
         s_revhash = new
Hashtable();                                           
         //    <Java encoding name>, <preferred MIME
name>                      
@@ -599,6 +602,9
@@                                                             
         s_revhash.put("CP870",
"EBCDIC-CP-YU");                                
         s_revhash.put("CP871",
"EBCDIC-CP-IS");                                
         s_revhash.put("CP918",
"EBCDIC-CP-AR2");                               
+       //
JFC                                                                  
+        s_revhash.put("OSD_EBCDIC_DF04_1",
"OSD_EBCDIC_DF04_1");               
+        s_revhash.put("8859_15",
"ISO-8859-15");                               
    
}                                                                          
                                                                                
     private MIME2Java()
{                                                      
++++++

I hope it helps

Cheers

Jean-frederic

> 
> ------- �������� ��������� -------
> ����: 22.02.01, 15:14
> ��: jean-frederic clere <[EMAIL PROTECTED]>
> ����: <[EMAIL PROTECTED]>
> ����: Re: win-1251  encoding support
> 
> olegabr wrote:
> >
> > hi all!
> > I use xerces-j 1.3.0 with jdk 1.1.8
> > and I try to parse xml files which was written under windows-1251
> > encoding. And I have an error: unsupported encoding "windows-1251".
> > So, what can I do to avoid this problem?
> >                                                                      
> > olegabr.
> 
> I have found at iana:
> +++
> Name: windows-1251
> MIBenum: 2251
> Source: Microsoft  (see ../character-set-info/windows-1251)
> [Lazhintseva]
> Alias:
> +++
> 
> Try looking in: src/org/apache/xerces/readers/MIME2Java.java the xerces
> supported encoding are there.
> 
> On the  machine where the data where typed in try the following test:
> +++
> encoding = System.getProperty("file.encoding", "8859_1");
> +++
> Of course 8859_1 is not the excepted answer!
> Then check for this one in MIME2Java.java.
> 
> Cheers
> 
> Jean-frederic
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to