special char 0xFF convert to 0X1A with character set LATIN1_0A

Database

special char 0xFF convert to 0X1A with character set LATIN1_0A

i encountered a character set problem make me headache, please someone can help me.

there is a table t_special with database sever character set 'LATIN', then i execute the sql insert into t_special (specialchar) values('FF'xc) with session character set 'LATIN1_0A'. (column specialchar is varchar(10) type).

i execute the sql "select specialchar from t_special" with session character set 'LATIN1_0A' by jdbc, but the result hex value is not 0XFF, it is changed to 0X1A, someone can help me ?  

Tags (2)
2 REPLIES
Teradata Employee

Re: special char 0xFF convert to 0X1A with character set LATIN1_0A

You mentioned that column specialchar is varchar(10), but what is its character set? Specifically, is the "specialchar" column declared as:

specialchar varchar(10) character set latin

or

specialchar varchar(10) character set unicode

?

Teradata Employee

Re: special char 0xFF convert to 0X1A with character set LATIN1_0A

Are you trying to use the Euro sign? That won't work with session character set LATIN1_0A.

According to the Teradata Database Reference / International Character Set Support / Chapter 2 "Client Character Set Options" / section "ASCII Client Character Set Support", the session character set LATIN1_0A correspond to International standard character set ISO 8859-1.

International standard character set ISO 8859-1 is described on this Wikipedia page https://en.wikipedia.org/wiki/ISO/IEC_8859-1 and it says "ISO/IEC 8859-1 is missing some characters for French and Finnish text and the euro sign."

So you cannot use the Euro sign with session character set LATIN1_0A.

Instead, you should use a Unicode session character such as UTF8 or UTF16.