× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Scott,

        Thanks  a lot, 

Bes regards,

Vengoal


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Scott Klement
Sent: Saturday, March 19, 2005 1:39 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: XML Parser EXPAT DBCS encoding error


Hello,

> D encoding        s              5A   Inz('Big5')
>
> encoding = encoding + X'00';
> p = XML_ParserCreate(%addr(encoding));

Expat does not natively support Big5. From the Expat reference manual:

    Parser Creation

    XML_Parser XMLCALL
    XML_ParserCreate(const XML_Char *encoding);

    Construct a new parser. If encoding is non-null, it specifies a
    character encoding to use for the document. This overrides the document
    encoding declaration. There are four built-in encodings:

     * US-ASCII
     * UTF-8
     * UTF-16
     * ISO-8859-1

    Any other value will invoke a call to the UnknownEncodingHandler.

>
> How do I set the encoding support DBCS ?
>

Look under "XML_SetUnknownEncodingHandler" in the Expat reference manual
(member REF.HTML in source file EXPAT in LIBEXPAT) for information on how to
configure an unknown encoding handler.

I've never worked with Big5, but I did try to make one for EBCDIC and
failed. It seems to assume that certain characters will always match the
same values as they do in ASCII, even with an unknown encoding handler. If
your Big5 text is using an ASCII encoding, you'll probably be okay. If not,
you'll probably have to convert it to an ASCII version of Big5, and parse
that with your unknown encoding handler.

Also, it's not necessary to append x'00' to the string. (That was only
necessary in V3R2, starting with V3R7 we have options(*string)) just call it
as:
          p = XML_ParserCreate('Big5');

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.