I am using OCI in C. I execute a SELECT query and got a char string contains special german character.
Using SQL Development I have for example the string "Ich habe vier Äpfel" with VARCHAR2(45)
. Database has charset AL16UTF16
and WE8ISO8859P15
.
After SELECT
statement in C I got the string "Ich habe vier \304pfel", after a little search in ASCII page, \304 is octal number for the German character "Ä". But I am wondering, why it gets an octal number instead of hex number. Could you tell me, if I can change a setting or something else to get a hex number instead of octal number of the character?
I am using OCI in C. I execute a SELECT query and got a char string contains special german character.
Using SQL Development I have for example the string "Ich habe vier Äpfel" with VARCHAR2(45)
. Database has charset AL16UTF16
and WE8ISO8859P15
.
After SELECT
statement in C I got the string "Ich habe vier \304pfel", after a little search in ASCII page, \304 is octal number for the German character "Ä". But I am wondering, why it gets an octal number instead of hex number. Could you tell me, if I can change a setting or something else to get a hex number instead of octal number of the character?
1 Answer
Reset to default 1C uses octal (\nnn) as a default for escape sequences for characters with values beyond the basic ASCII range. This is part of the C standard. If you want a hexadecimal representation, you have to explicitly format it.
strlen(the returned string)
return? – Guillaume Outters Commented Feb 8 at 8:59