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



Yes. Thanx.

And also thanx to your subfile regex example on your site (which uses iconv() and provided me with an example =).

I got it working. One further step to have a working JSON checker on the i. Perhaps you'll see RPG on json.org as one language which has JSON support one day.

Regards

Mihael

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von Scott Klement
Gesendet: Montag, 16. Februar 2009 09:50
An: RPG programming on the IBM i / System i
Betreff: Re: QDCXLATE not working as expected

Hi Mihael,

You can type WRKTBL QASCII and use option 5 to see what this map will do.

Personally, I never use QASCII -- I have yet to find a situation where
it's the right translation table. I typically use QTCPASC if I need to
-- and usually if I do this, it's because I'm trying to throw together a
quick sample program for someone.

In a real application, however, I'd use iconv(). I mean... what are you
really talking about when you say "ASCII"? There are hundreds, if not
thousands, of completely different character sets that are all referred
to as "ASCII". Rather than be ambiguous, I prefer to use iconv() with
CCSIDs where I can specify EXACTLY which character set I'm converting
to/from.




Schmidt, Mihael wrote:
Hi,

i tried to convert some EBCDIC data to ASCII. I tried to use QDCXLATE and the code looks like this:


D translate PR extpgm('QDCXLATE')
D length 5P 0 const
D data 32766A options(*varsize)
D table 10A const


D string S 100A

/free
string = '{ "Test" : true }';

translate(%size(string) : string : 'QASCII');

*inlr = *on;
return;
/end-free


I would have expected to see something like this in hex:
7B202254 65737422 203A2074 72756520 7D202020

But i got this in hex:
A2202254 65737422 203A2074 72756520 F0202020

The starting and ending curly braces are not correctly translated to ASCII.
{ = 7B and not A2
} = 7D and not F0

Am I doing something wrong?

Thanx in advance

Mihael Schmidt
Anwendungsentwicklung

Dirk Rossmann GmbH
Iserhägener Str.16
30938 Burgwedel
* +49 (05139) 898 - 4353

Handelsregister-Nr. HRB 120546, Amtsgericht Hannover
Ust-Id-Nr. DE 115055186
St.-Nr. 16 / 205 / 65401
Geschäftsführer: Dirk Roßmann, Alice Schardt-Roßmann, Roland Frobel, Klaus Praus



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.