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



Ok, so I set up the field with CCSID 1208 in the DDS. I didn't specify the
*NORMALIZE option. From what I understand, this will fix any
non-corresponding hex values to the closest match available?

When would this be required if the data is already UTF-8, and is it good
practice to use it?

The YAJL_GET_STRING_UTF8() is being used to retrieve the data from the JSON
and seems to work great as well.

I created a program that reads through the data and uses iConv to convert
from 1208 to 0 (job CCSID) and that also seems to work, although of course
viewing the Chinese characters just shows garbage.

We shall see if this will help. But I'm wondering if there are any RPG
D-Spec keywords one can use so that when data is read in from this field it
is automatically converted to the JOB's CCSID? Or is iConv (or another
conversion API) required?

Thanks!

Brad


On Fri, Jun 10, 2016 at 11:51 AM, John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:

On Fri, Jun 10, 2016 at 12:29 PM, Bradley Stone <bvstone@xxxxxxxxx> wrote:
I'm thinking this data I may need
to read in using YAJL_GET_STRING_UTF8() (one of the newer functions
added
to the YAJL port) and store it as CCSID(1208).

Then I imagine if you want to process it you will need to read it in and
convert it to the jobs CCSID?

I think this is pretty much the standard approach with just about any
text processing today (on any platform) that has to handle more than
one language/encoding. The world has more-or-less standardized on
UTF-8 as the One Encoding to Rule Them All, so anything "internal"
(not directly user-facing) should be in this encoding; you convert
user input at the earliest possible moment from whatever the user is
using into UTF-8; you convert user-facing output at the latest
possible moment from UTF-8 to whatever the user is using.

Obviously, things might get messier in any given real-world scenario,
but that is what you are striving for.

John Y.
--
This is the RPG programming on the IBM i (AS/400 and 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.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.