Home: Perl Programming Help: Advanced:
Perl: How to convert db2 utf8 czech special character to latex format



zimso
New User

Sep 28, 2016, 8:06 AM


Views: 10671
Perl: How to convert db2 utf8 czech special character to latex format

Hello,

please maybe someone can help me :

- I have a DB2 database which is in codeset UTF-8 and codepage 1208
- I have a field "lastname" which has some names which contain east
european special character ( and // s with caron or a with acute)
- my environment on the shell is LANG=de_DE.utf8
- I read the DB field with DBI module into Perl and want to convert the
name to latex format for printing, but it doesn't work for the
"s with caron"

(a with a acute) (Unicode-Nummer: U+00E1 HTML-Code: á)
---->wanted goal: Latex format \'{a}
(s with caron) (Unicode-Nummer: U+0161 HTML-Code: š)
---->wanted goal: Latex format \v{s}

I don't manage to convert the "s" character:

$tmp has ' '
I try a print TeX::Encode::encode('latex',$tmp);
It gives : \'a?

\'a is correct
"?" for the "" is not

When I directly save the field to a file and look with a hexeditor on
it it says: "e1 1a"

e1 is correct
"1a" isn't (according to latin-2 it should be "b9")

Hmmm... Can someone please help me to manage to bring these east european
names from a utf8 db to a universal latex format for printing ?

Many Many Thanks !!!!!!

Tina