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



I think the main requirement would be that RPG would have to support a
string data type. Where the length of the string is the number of
characters it contains. Compared to RPG which measures a string as the
number of bytes.

Not that I fully understand the difference between unicode and UTF-8, And
whether emojis are the same as unicode characters. Here is javascript code
that handles a string of emoji characters perfectly. That is, the length of
the string is the number of characters. And you can index into the string
by specifying the position of the character in the string.

function dumpUnicode()
{
const uniCodeText = 'abc ♥ ❤ ❥ ❣ ❦ ❧ xyz'
let codePointText = '';
let unicode_chars = '';
for (let ix = 0; ix < uniCodeText.length; ++ix)
{
const ch1 = uniCodeText[ix];
if ( ch1 != ' ')
{
if ( unicode_chars )
unicode_chars += ' ';
unicode_chars += ch1;
}

const num = uniCodeText.codePointAt(ix);
if (codePointText)
codePointText += ' ';
codePointText += num.toString();
}

console.log(`unicode characters:${unicode_chars}`);
console.log(`unicode text length:${uniCodeText.length}`);
console.log(`unicode code points:${codePointText}`);
}

output:
unicode characters:a b c ♥ ❤ ❥ ❣ ❦ ❧ x y z
unicode text length:19
unicode code points:97 98 99 32 9829 32 10084 32 10085 32 10083 32 10086 32
10087 32 120 121 122

-Steve


On Sun, Feb 26, 2023 at 6:04 PM Javier Sanchez <
javiersanchezbarquero@xxxxxxxxx> wrote:

What the subject wants to drive, is into a discussion about all the issues
that are related to the conversion between EBCDIC and the rest of the
world's most used non-EBCDIC encoding.

I say "non-EBCDIC" just to say perfectly well anything that is not EBCDIC
so clearly. IBM's success on their IBM i systems is so good and I share
the happiness to have made it into this world. However, one has to face
this very particular problem when it comes to the CCSID world. It's so
annoying. There should now be only one standard.

Yeah, yeah, yeah, many of you would come up and say "you can do it and
nothing stops you". There will always be a conflict. While Big Blue keeps
with EBCDIC, conversion between something different from EBCDIC and EBCDIC
will prevail.

Creating databases from CCISD 037 to something else than that, is a pain in
the heart. You will always get to run and fix that.

Why not, at all, finally, IBM turns into Unicode for all stuff?

TIA

Javier Sanchez
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



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.