Loading ...
Sorry, an error occurred while loading the content.
 

org.xml.sax.SAXParseException: Invalid encoding name "Cp1252".

Expand Messages
  • Jumolko
    Hi, I wrote a java program that creates a XMLDBMSMap from a DTD. Until there, no problem. I serialize this map, and when I want to recover my map from the
    Message 1 of 2 , Feb 24, 2004
      Hi,

      I wrote a java program that creates a XMLDBMSMap from a DTD. Until
      there, no problem. I serialize this map, and when I want to recover my
      map from the file, I got this mistake:

      org.xml.sax.SAXParseException: Invalid encoding name "Cp1252".
      at
      org.xmlmiddleware.xmldbms.maps.factories.MapCompiler.compile(MapCompiler.java:239)

      Please can anyone tell me why it appears, and/or what encoding I can use
      instead?
      Thanks by advance.

      -- Julien


      // Open a FileOutputStream and serialize the Map to that stream.
      File mapFile = new File("test.map");
      OutputStreamWriter osw = new OutputStreamWriter(new
      FileOutputStream(mapFile));
      MapSerializer serializer = new MapSerializer(osw);
      serializer.serialize(map);

      //recovering the Map
      InputSource saxSource = new InputSource(new FileInputStream("test.map"));
      XMLReader reader=
      XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
      MapCompiler compiler = new MapCompiler(reader);
      XMLDBMSMap theMap = compiler.compile(saxSource);
    • Ronald Bourret
      If you don t specify an encoding, the Writer used by MapSerializer uses the default encoding. On Windows machines, this appears to be Cp1252 (at least that s
      Message 2 of 2 , Feb 27, 2004
        If you don't specify an encoding, the Writer used by MapSerializer uses
        the default encoding. On Windows machines, this appears to be Cp1252 (at
        least that's what I get on my machine). The problem seems to be that
        your XML parser doesn't support this encoding.

        If your code calls MapSerializer, use an OutputStreamWriter on which you
        have explicitly set the encoding. See the code example in MapSerializer
        for details.

        If you are using MapManager, specify the encoding with the Encoding
        property.

        -- Ron

        Jumolko wrote:
        >
        > Hi,
        >
        > I wrote a java program that creates a XMLDBMSMap from a DTD. Until
        > there, no problem. I serialize this map, and when I want to recover my
        > map from the file, I got this mistake:
        >
        > org.xml.sax.SAXParseException: Invalid encoding name "Cp1252".
        > at
        > org.xmlmiddleware.xmldbms.maps.factories.MapCompiler.compile(MapCompiler.java:239)
        >
        > Please can anyone tell me why it appears, and/or what encoding I can use
        > instead?
        > Thanks by advance.
        >
        > -- Julien
        >
        > // Open a FileOutputStream and serialize the Map to that stream.
        > File mapFile = new File("test.map");
        > OutputStreamWriter osw = new OutputStreamWriter(new
        > FileOutputStream(mapFile));
        > MapSerializer serializer = new MapSerializer(osw);
        > serializer.serialize(map);
        >
        > //recovering the Map
        > InputSource saxSource = new InputSource(new FileInputStream("test.map"));
        > XMLReader reader=
        > XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
        > MapCompiler compiler = new MapCompiler(reader);
        > XMLDBMSMap theMap = compiler.compile(saxSource);
        >
        > To post a message, send it to: xml-dbms@yahoogroups.com
        > To unsubscribe, send a blank message to: xml-dbms-unsubscribe@yahoogroups.com
        > Or join the newsgroup at: news://news.barkto.com/homeless.xml.xml-dbms
        > Yahoo! Groups Links
        >
        >
        >
        >

        --
        Ronald Bourret
        Programming, Writing, and Research
        XML, Databases, and Schemas
        http://www.rpbourret.com
      Your message has been successfully submitted and would be delivered to recipients shortly.