Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2002
    Posts
    17

    Unanswered: 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);

    %>

  2. #2
    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!!!!!

  3. #3
    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.....

  4. #4
    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??!??!?!?!?!

  5. #5
    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...

  6. #6
    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

  7. #7
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •