unicode conversion: get X'3D at line end



Help for C/C++ for MVS, OS/390 C/C++, z/OS C/C++ and C/C++ Productivity Tools for OS/390

unicode conversion: get X'3D at line end

Postby kjesse » Fri Oct 01, 2010 12:45 pm

Hi!

I am converting with a C program using iconv data from UTF-8 to EBCDIC but I get alwys in the output one complete line and the different input lines are separated by X'3D. I don't know what IBM z/OS makes with the line end during conversion. Can anyone help?

Thanks

Klemens
kjesse
 
Posts: 13
Joined: Tue Sep 21, 2010 9:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: unicode conversion: get X'3D at line end

Postby Robert Sample » Fri Oct 01, 2010 4:38 pm

I'm sure you understand what you're doing, but you have not explained it clearly enough for anyone to help you. For example, this
get alwys in the output one complete line and the different input lines are separated by X'3D.
makes no sense -- iconv function does not convert lines, it converts characters. For any real help, you need to provide a sample input string, the iconv output for that string (use the Code tag and hexadecimal display so we can see exactly what each character is), and then tell us where you think the problem is and why you think it is a problem.

The EBCDIC hex value for a carriage return is X'0D' while a newline character is X'15'. Either -- or both -- of these could be used to mark lines, although iconv does not pay attention to line ending characters since it is based on the buffer length passed to it.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: unicode conversion: get X'3D at line end

Postby kjesse » Fri Oct 01, 2010 5:59 pm

I convert a text file written in UTF8 with 3 text lines (German) to EBCDIC German. Afterwards I have compare the hexdumps. At the beginning there is X'3F as a difference input/output file. That could arise from "BOM" (Border of mark) which characterizes a UTF8 file under a lot of systems. And the end of each text line there is X'3D as a difference and I do not know how iconv handles control characters like delimiter, end of line on a Mainframe. Where does the X'3D arise from? Thanks for any hint. When this is not clear enough, I will attach examples (hexdump, text etc.)

Regards

Klemens
kjesse
 
Posts: 13
Joined: Tue Sep 21, 2010 9:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: unicode conversion: get X'3D at line end

Postby kjesse » Mon Oct 04, 2010 12:27 pm

Hi!

When I do a roundtrip under Linux with the same C program (that means conversion UTF8 -> EBCDIC -> UTF8), the first and third file is absolutely identical as it should be. But under IBM z/OS I get for UTF8 -> EBCDIC conversion X'3D at the end and not X'15. I've found out that UTF8 X'15 is the same as EBCDIC X'3D. Could it be that IBM cannot convert new line (control character) into EBCDIC but the rest of text? There stands UTF8 X'15 after conversion (?) I would be thankful for any help.

Regards

Klemens
kjesse
 
Posts: 13
Joined: Tue Sep 21, 2010 9:26 pm
Has thanked: 0 time
Been thanked: 0 time


Return to C, C++

 


  • Related topics
    Replies
    Views
    Last post