vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I am setting up a database which requires some tables to store Thai language data, as well as English data. For this, during the DB creation of the test database, I set the following properties for the DB: -Database territory= TH -Database code set= UTF-8 and DB2 set these values by default: -Database code page= 1208 -Database country/region code= 66 After this, I inserted values into the column but the DB seems to store and return junk values. I need to find out fast what values I should set during the create db process to be able to support Thai and English data. The create db statement takes in the following params, for which I need to set the correct values: -CODESET -CODEPAGE -NLS CHAR SET -COLLATE COMPATIBILITY -IDENTITY -IDENTITY_16BIT Desperatly Seeking GURU! Thanks in advance. kP |
| |||
| Hi Kanv, You are on the right track. Code set UTF-8 and territory TH can be used to store data in English, Thai and many other languages. You can also use codeset TIS620-1 and terrtiroy TH to store English and Thai data only. There must be some other things that were set incorrectly. Did you set DB2CODEPAGE? What database application did you use? What operating system did you use? What is the language environment of your operating system? Sherman "Kanv" <kanvpandit@hotmail.com> wrote in message news:2554c5c7.0404022231.3489653c@posting.google.c om... > Hi, > > I am setting up a database which requires some tables to store Thai > language data, as well as English data. For this, during the DB > creation of the test database, I set the following properties for the > DB: > -Database territory= TH > -Database code set= UTF-8 > and DB2 set these values by default: > -Database code page= 1208 > -Database country/region code= 66 > > After this, I inserted values into the column but the DB seems to > store and return junk values. I need to find out fast what values I > should set during the create db process to be able to support Thai and > English data. > > The create db statement takes in the following params, for which I > need to set the correct values: > -CODESET > -CODEPAGE > -NLS CHAR SET > -COLLATE COMPATIBILITY > -IDENTITY > -IDENTITY_16BIT > > Desperatly Seeking GURU! > > Thanks in advance. > > kP |
| |||
| Hi Sherman, Thanks for the post. OS: Win2K. Lnaguage Settings: Have set regional settings on DB machine to support both English and Thai input. Codepage: 1208. Have also tried code page 874 with TIS620-1. With no luck. Is there anything I am missing out? With the language set to THAI, when I enter the Thai data into the 'Command Center' it just shows junk and once data is inserted into the table and retrieved, its junk too. KP |
| |||
| On 2004-04-08, Kanv scribbled: > Hi Sherman, > > Thanks for the post. OS: Win2K. Lnaguage Settings: Have set regional > settings on DB machine to support both English and Thai input. > Codepage: 1208. Have also tried code page 874 with TIS620-1. With no > luck. > > Is there anything I am missing out? With the language set to THAI, > when I enter the Thai data into the 'Command Center' it just shows > junk and once data is inserted into the table and retrieved, its junk > too. > > KP One other question that might help... Are you using CHAR/VARCHAR or GRAPHIC/VARGRAPHIC fields to store the text? CHAR/VARCHAR are stored as UTF-8 in Unicode databases (codepage 1208), while GRAPHIC/VARGRAPHIC are stored as UCS-2. Furthermore, while the UTF-8 CHAR/VARCHAR fields will be translated into the client's codepage, UCS-2 GRAPHIC/VARGRAPHIC fields will not undergo any translation: Administration Guide - Planning - Appendix E: "When an application program is connected to a UCS-2 database [created with codepage 1208], character string data is converted between the application code page and UTF-8 by DB2 UDB, but graphic string data is always in UCS-2." If you are using CHAR/VARCHAR fields, have you tried using GRAPHIC/VARGRAPHIC fields instead - or vice versa? HTH, Dave. -- Dave Remove "_nospam" for valid e-mail address "Never underestimate the bandwidth of a station wagon full of CDs doing a ton down the highway" -- Anon. |
| |||
| On 2004-04-12, Kanv scribbled: > Hi Dave, > > There are only a couple of fields and they are all VARCHAR. My DB is > on NT, and I also tried installing the Thai language set on the > OS...just to be sure. But still.... no can do Thai. > > > > KP Hi Kanv, Okay. Try changing the definition of the fields from VARCHAR to VARGRAPHIC instead (GRAPHIC is DB2's slightly bizarre name for 2-byte characters). As I mentioned in the previous post, VARGRAPHIC fields undergo no translation so, assuming it's the UTF-8 conversion that is trashing the data, this might make a difference. One thing to note though: because VARGRAPHIC fields contain 2-byte characters, as opposed to VARCHAR which stores 1-byte characters (although up to 3-bytes can be used for characters by the UTF-8 encoding scheme) the maximum length of a VARGRAPHIC field is half that of an equivalent VARCHAR field. Hence, while the maximum size for a VARCHAR field definition is 32672, the maximum size for a VARGRAPHIC field is 16336. I must admit I'm skeptical that the UTF-8 conversion could be trashing the data (it's not exactly a difficult piece of code - and there are numerous reference implementations). I think it's more likely that something "either side" of the database (the application(s) being used to insert and/or retrieve the data) are doing something strange. Maybe the output isn't being translated from UTF-8 and you're seeing raw UTF-8 encoding? If the above suggestion doesn't work, could you send a sample of the trashed data to my e-mail? If you can manage it, a screen shot would be good too (to avoid any mail gateways translating the data any further). I'm on DSL so it doesn't matter if it's large (obviously, don't post it here! :-) HTH, Dave. -- Dave Remove "_nospam" for valid e-mail address "Never underestimate the bandwidth of a station wagon full of CDs doing a ton down the highway" -- Anon. |