Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Sybase > Trying to use UTF8 and japanese. Is it possible?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-20-02, 16:11
Marc Marc is offline
Registered User
 
Join Date: Jan 2002
Posts: 17
Trying to use UTF8 and japanese. Is it possible?

Hi folks,

Platform : Win2k (english and japanese)
Problem : Trying to use UTF8 and japanese

I am new to sybase but I have loads of experience with Oracle and MsSQL and they cope quite well with this and it ain't rocket science to get those 2 working. I was expecting a similar experience with sybase but this has proved not to be that case. The data in the script below is just going in as question marks even though I have everything (I think) set up as utf8. Am I missing something? any help would be appreciated. (Please don't refer me to sybase documentation. I've been through it and it ain't no help.

Thanks

Marc

<%@ CodePage=65001 Language=JavaScript%>
<%

ADO=new ActiveXObject('ADODB.RecordSet');

s='催される';

c='Provider=Sybase.ASEOLEDBProvider.2;Initial Catalog=mydb;User ID=sa;Data Source=myds;Password=;Character Set=utf8';

//comment the following line out after the first run
ADO.Open("create table test(utf nchar(40))",c);

//ADO.Open("update test set utf=N'催される'",c);

ADO.Open("insert into test (utf)values('催される')",c);

ADO.Open('select * from test',c);

s=ADO.Fields('utf')+'';

Response.Write(s);

%>
Reply With Quote
  #2 (permalink)  
Old 02-21-02, 14:18
Marc Marc is offline
Registered User
 
Join Date: Jan 2002
Posts: 17
Well I Found out the answer to this one by myself. Ain't I just great.

...so I thought that I'd share this wisdom with you.

Its a bit mad and sybase people should hang their head in shame for this one. How are you suppossed to compete with mssql and oracle if you don't provide support for utf8/ucs2 as good as them?

anyway....

Scenario:
I have a server with ASE installed with utf8 as the db characterset.

I have an english client and a japanese client.

My english client cannot insert or see japanese data in the server.
My japanese client can insert and see japanese and english characters in the server.

Sybase just works this way. and the funny thing is I found it in their documentation (which I asked not to be used in reply to my mail..doh!)

check out
"configuring client/server character set conversions" in the "system administration guide"..chapter8....just read the paragraph after figure 8-2..... and then burn it :-)

I would just like to thank myself for such a brilliant reply!
Well done!!!!!
Reply With Quote
  #3 (permalink)  
Old 02-22-02, 04:46
raju raju is offline
Registered User
 
Join Date: Jan 2002
Posts: 28
Marc,

Do not blame on the server without reading our dbforums... in my previous issue i have solved by changing the default charset in locales.dat file.

you can also try by changing the default charset in your clients locales.dat file (c:/sybase/locales) to be utf8 from iso_1 charset.

best of luck.. do not blame on sybase.....
Reply With Quote
  #4 (permalink)  
Old 02-22-02, 05:55
Marc Marc is offline
Registered User
 
Join Date: Jan 2002
Posts: 17
Talking

Thanks for the reply Raju,

Well I have actually seen this mentioned before (believe me I have spent the week going through all the docuementation and dbforums...painful to say the least) and I have changed all the default locales (I'm sure only the [NT] one needs changing but I changed them all just to be sure) on both the client and server.

I restarted the ASE on the server (which is a japanese OS) and restarted my client app on my English OS but it is still showing me garbage when I view japanese data. And when I add japanese character data from the client it is still going into the sqlserver as '?????'.

I do feel that this should be possible and it must be a client setting. Am I missing something. Please tell if it is so. TeamSybase have been very quiet. Maybe they're pleading the 5th amendment...

Guys??!??!?!?!?!
Reply With Quote
  #5 (permalink)  
Old 02-24-02, 22:50
raju raju is offline
Registered User
 
Join Date: Jan 2002
Posts: 28
Hi

Did you tried by changing in Client (NT) by changing in locales.dat file by chaging the default charset to be utf8... I have same issue in chinese chars but we solved thor' this method.. try and tell me the result... for jap charset... best of luck...
Reply With Quote
  #6 (permalink)  
Old 02-25-02, 07:20
Marc Marc is offline
Registered User
 
Join Date: Jan 2002
Posts: 17
I changed the settings on both the client and the server to look like below

[NT]
locale = enu, us_english, iso_1
locale = fra, french, iso_1
locale = deu, german, iso_1
locale = rus, russian, cp1251
locale = hun, us_english, cp1250
locale = ell, us_english, cp1253
locale = heb, us_english, cp1255
locale = ara, us_english, cp1256
locale = trk, us_english, cp1254
locale = esp, spanish, iso_1
locale = jpn, japanese, sjis
locale = japanese, japanese, sjis
locale = chs, chinese, eucgb
locale = cht, tchinese, big5
; locale = kor, korean, eucksc
locale = us_english.utf8, us_english, utf8
locale = default, us_english, utf8
.................

so the last line I take is the relevant one

locale = default, us_english, utf8

This did not succeed in my seeing japanese characters.

I wonder if I set it to be

locale = default, japanese, sjis
or
locale = default, us_english, sjis

I'll give them a try and tell you how I get on...

Can you show me your settings?

Thanks

Marc
Reply With Quote
  #7 (permalink)  
Old 02-25-02, 10:31
Marc Marc is offline
Registered User
 
Join Date: Jan 2002
Posts: 17
I actually tried load of combinations
Here is the last one I used...
[NT]
locale = enu, us_english, utf8
locale = fra, french, utf8
locale = deu, german, utf8
locale = rus, russian, cp1251
locale = hun, us_english, cp1250
locale = ell, us_english, cp1253
locale = heb, us_english, cp1255
locale = ara, us_english, cp1256
locale = trk, us_english, cp1254
locale = esp, spanish, utf8
locale = jpn, japanese, utf8
locale = japanese, japanese, utf8
locale = chs, chinese, eucgb
locale = cht, tchinese, big5
; locale = kor, korean, eucksc
locale = us_english.utf8, us_english, utf8


What was the language on the OS that you were running your client from? Mine is English.

Do you have to reboot or do something before the settings take effect?

Thanks
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On