× 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.



Thanks Brad - I had been thinking along those lines but then found a reference from Scott about using the underlying C routines directly if the data was already in UTF-8.

For the archives the solution actually requires two steps:

1) Use the function yajl_tree_parse() - which is what yajl_buf_load_tree() does under the covers. And ...

2) In order to make the compile work add:

/Define YAJL_C_PROTOTYPES

Ahead of the /COPY of the YAJL prototypes, otherwise the "raw" C ones are excluded from the compile.

So far it seems to be working - but still plenty of time for things to go down the drain!


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jun 29, 2017, at 3:35 PM, Bradley Stone <bvstone@xxxxxxxxx> wrote:

I'm not sure there's an option for that. I always use GETURI to
retrieve the data and use yajl_stmf_load_tree() to load the data into
memory.

It looks to be simple enough to add an option for EBCDIC data or not
in yajl_buf_load_tree().

If you compare yajl_buf_load_tree() with yajl_stdin_load_tree() you
can see that the conversion to UTF-8 in yajl_buf_load_tree() is done
all the time assuming it's EBCDIC data.

A simple addition of a parameter to tell it if it's UTF-8 and if it's
on, don't do the conversion to UTF-8. Or, make a new subprocedure
like yajl_buf_load_tree_utf8() that is a copy of yajl_buf_load_tree()
but simply bypasses the conversion.

Bradley V. Stone
www.bvstools.com
MAILTOOL Benefit #2: The ability to specify a "From" and/or "Reply To"
email address!

On Thu, Jun 29, 2017 at 12:44 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:
For reasons of speed I'm attempting to keep everything in my web services in UTF-8.

I used YAJL to build the request packet in UTF-8 and send it. I receive the response (via HTTPAPI) in UTF-8 and not need to load the YAJL tree and parse the response.

But yajl_buf_load_tree() is defined as requiring EBCDIC input and I can't find a UTF-8 equivalent.

Since everything else in YALJ is UTF-8 oriented this seems a little odd.

Am I missing something obvious here?


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.

--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



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.