Tags: 10g, al32utf8, character, correctly, created, database, mysql, octets, oracle, select, sql, standard, stored, unicode, utf-8, utf8

Select UNICODE (UTF8) data as octets from database Options

On Database » Oracle

4,875 words with 4 Comments; publish: Sun, 01 Jun 2008 11:46:00 GMT; (25078.13, « »)

Hi.

My database (10g) has been created with database character set to

"Unicode standard UTF-8 AL32UTF8".

The data has been stored correctly. Used select dump(name, 1016)

from...

Query returned:

Len = 3 CharacterSet=AL32UTF8: e4, b8, 84

UTF-8 encoding of Unicode character (Traditional Chinese): 丁

Can someone tell me how to select this col into a ProC VARCHAR2

variable? The query in my ProC code returns this a value, but the

lenght is equal to 1. How can I get all the 3 octets into my VARCHAR2

variable?

Does it depends on any compilation option, or the PC locale?

BR,

Helge Hauan

All Comments

Leave a comment...

  • 4 Comments
    • OracleServer schreef:

      > Hi.

      > My database (10g) has been created with database character set to

      > "Unicode standard UTF-8 AL32UTF8".

      > The data has been stored correctly. Used select dump(name, 1016)

      > from...

      > Query returned:

      > Len = 3 CharacterSet=AL32UTF8: e4, b8, 84

      > UTF-8 encoding of Unicode character (Traditional Chinese): 丁

      >

      > Can someone tell me how to select this col into a ProC VARCHAR2

      > variable? The query in my ProC code returns this a value, but the

      > lenght is equal to 1. How can I get all the 3 octets into my VARCHAR2

      > variable?

      > Does it depends on any compilation option, or the PC locale?

      >

      > BR,

      > Helge Hauan

      >

      If Pro*C, your varchar2 would be the Oracle varchar2.

      In that case, you'll need Nvarchar2; and you also

      want to define it as nvarchar2(30 char), if your name

      would consist of 30 characters

      If C - I'm long done with that, V5 of MSC is the last

      I ever worked with - sorry.

      Regards,

      Frank van Bortel

      Top-posting is one way to shut me up...

      #1; Sun, 01 Jun 2008 11:47:00 GMT
    • On 18 Apr, 20:27, Frank van Bortel <frank.van.bor....oracle.itags.org.gmail.com> wrote:

      > OracleServer schreef:

      >

      >

      >

      > If Pro*C, your varchar2 would be the Oracle varchar2.

      > In that case, you'll need Nvarchar2; and you also

      > want to define it as nvarchar2(30 char), if your name

      > would consist of 30 characters

      > If C - I'm long done with that, V5 of MSC is the last

      > I ever worked with - sorry.

      > --

      > Regards,

      > Frank van Bortel

      > Top-posting is one way to shut me up...– Skjul sitert tekst –

      > – Vis sitert tekst –

      Hi again.

      Since this is an already existing database and we are migrating to

      Traditional Chinese the existing column has previously defined as

      VARCHAR2, not NVARCHAR2. According to Oracle guide I should select the

      column into a utext variable (unsigned short), but this is not what I

      want to do, because it seems that this variable is ment to be used for

      UTF16, and not UTF8.

      #2; Sun, 01 Jun 2008 11:48:00 GMT
    • OracleServer <helge.hauan.oracle.itags.org.applica.no> wrote:

      > My database (10g) has been created with database character set to

      > "Unicode standard UTF-8 AL32UTF8".

      > The data has been stored correctly. Used select dump(name, 1016)

      > from...

      > Query returned:

      > Len = 3 CharacterSet=AL32UTF8: e4, b8, 84

      > UTF-8 encoding of Unicode character (Traditional Chinese): ?

      >

      > Can someone tell me how to select this col into a ProC VARCHAR2

      > variable? The query in my ProC code returns this a value, but the

      > lenght is equal to 1. How can I get all the 3 octets into my VARCHAR2

      > variable?

      > Does it depends on any compilation option, or the PC locale?

      It should depend only on the NLS_LANG environment variable.

      You must set it to something that supports this 'shang' character,

      like 'SIMPLIFIED CHINESE_CHINA.ZHS16GBK' or AMERICAN_AMERICA.AL32UTF8

      There is a precompiler option NLS_CHAR with which you can specify which

      host variables will be treated as multibyte variables.

      Yours,

      Laurenz Albe

      #3; Sun, 01 Jun 2008 11:49:00 GMT
    • On May 7, 10:32 am, Laurenz Albe <inv....oracle.itags.org.spam.to.invalid> wrote:

      > OracleServer <helge.ha....oracle.itags.org.applica.no> wrote:

      >

      > It should depend only on the NLS_LANG environment variable.

      > You must set it to something that supports this 'shang' character,

      > like 'SIMPLIFIED CHINESE_CHINA.ZHS16GBK' or AMERICAN_AMERICA.AL32UTF8

      > There is a precompiler option NLS_CHAR with which you can specify which

      > host variables will be treated as multibyte variables.

      > Yours,

      > Laurenz Albe- Hide quoted text -

      > - Show quoted text -

      Hi again.

      Tried both NLS_LANG and NLS_CHAR without success. In Pro*C the select

      statements returns wide character string, not octet character string.

      I solved the problem by making a convert coding-function WcsToUTF8.

      #4; Sun, 01 Jun 2008 11:50:00 GMT