|
Hi Vern,upport midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com
One thing that could actually work is reading the data in ccsid UCS-2
(13488). That covers almost all character (or maybe even all
characters) of UTF-8. Then Greg could replace e.g. the SINGLE
QUOTATION MARKS by a charcater that can be translated to EBCDIC, for
example a SINGLE QUOTE ('). He could do the same for other characters
that have an almost equal counterpart in EBCDIC.
Once that is done, he could translate the UCS-2 string to EBCDIC.
Basically that worked for me (quick and dirty test). But there is a
problem I do not understand. The key is that %str() does not work for
determing the length of the buffer returned by fgets().
Here are some examples returned by fgets():
EOL charcater: CRLF, o_CCSID=13488
00000 FFDE0022 00410042 00430031 00320033 - █ú... .â.{......
00010 0022002C 00222019 004200E4 00720062 - .........â.U.Ê.Â
00020 0065006C 20190020 004200F6 0068006D - .Á.%.....â.6.Ç._
00030 0022002C 00220053 006F006D 00650020 - .......ë.?._.Á..
00040 00530074 00720065 00650074 0022002C - .ë.È.Ê.Á.Á.È....
00050 00220053 006F006D 00650020 00430069 - ...ë.?._.Á...{.Ñ
00060 00740079 0022002C 00220047 00650072 - .È.`.......å.Á.Ê
00070 006D0061 006E0079 0022002C 00220022 - ._./.>.`........
00080 002C0022 00340030 00370032 00310022 - ................
00090 002C0031 00300030 0030002E 00300030 - ................
000A0 00000A00 40404040 40404040 40404040 - ....
-- where does this byte belong to???
and why is LF = x'000A'?
EOL character: LF, o_CCSID=13488
00000 FFDE0022 00410042 00430031 00320033 - █ú... .â.{......
00010 0022002C 00222019 004200E4 00720062 - .........â.U.Ê.Â
00020 0065006C 20190020 004200F6 0068006D - .Á.%.....â.6.Ç._
00030 0022002C 00220053 006F006D 00650020 - .......ë.?._.Á..
00040 00530074 00720065 00650074 0022002C - .ë.È.Ê.Á.Á.È....
00050 00220053 006F006D 00650020 00430069 - ...ë.?._.Á...{.Ñ
00060 00740079 0022002C 00220047 00650072 - .È.`.......å.Á.Ê
00070 006D0061 006E0079 0022002C 00220022 - ._./.>.`........
00080 002C0022 00340030 00370032 00310022 - ................
00090 002C0031 00300030 0030002E 00300030 - ................
000A0 000A0040 40404040 40404040 40404040 - ...
---- why is LF = x'000A'?
EOL character: CRLF, o_CCSID=0
00000 FFDE7FC1 C2C3F1F2 F37F6B7F 3FC2C099 - █ú"ABC123",".Bär
00010 8285933F 40C26A88 947F6B7F E2969485 - bel. Böhm","Some
00020 40E2A399 8585A37F 6B7FE296 948540C3 - Street","Some C
00030 89A3A87F 6B7FC785 99948195 A87F6B7F - ity","Germany","
00040 7F6B7FF4 F0F7F2F1 7F6BF1F0 F0F04BF0 - ","40721",1000.0
00050 F0250040 40404040 40404040 40404040 - 0..
-- that is fine. LF = x'25' in EBCDIC
I do not understand the last bytes of example 1 and 2. CRLF in UCS-2
should be x'240D' (CR) and x'240A' (LF), shouldn't it?
How could we get the length of the buffer returned by fgets()?
Thomas.
This mailing list archive is Copyright 1997-2026 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.