Skip to Content
author's profile photo Former Member
Former Member

how to change sybase character set to UTF8

how to change sybase character set to UTF8??

any one please tell me the

1) pre steps??

2) process?

3) poststeps?

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Nov 25, 2015 at 03:47 PM

    basic steps:

    make sure you have backups of all databases

    to change character set and / or sort order you first need to load the required character sets

    then reconfigure your server for the new character set / sort order

    this option is static, you need to restart your ASE server

    it will automatically shutdown after the restart, another restart is required

    when changing to multiple byte character set you might need to take more steps to handle existing data. like copy data out and back in e.g. using bcp.

    For changing character sets or sort order see Sybooks Online

    Adaptive Server Enterprise 15.7 ESD #2 > System Administration Guide: Volume 1 > Configuring Character Sets, Sort Orders, and Languages > Changing the character set, sort order, or message language > Unicode examples

    There's even a topic converting to UTF-8

    Add a comment
    10|10000 characters needed characters exceeded

    • check the Admin guide, all steps are there

      please note that the commands below do not cover any data issues

      If you have existing data in your server, you might need to copy out / in all data to handle the conversion properly. Also, moving to multi-byte character set might require changes to user tables.

      to load, use command charset, e.g. charset -Usa -S<your ASE server> binary.srt utf8

      the sort order depends on what you want, binary.srt is example if you want binary sort order

      to reconfigure your sort order, change server option: default sortorder id

      to reconfigure character set, change option: default character set id

      after changing the sort order or character set you'll need to restart your ASE server twice

  • author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2015 at 01:50 PM

    1) Generally it is suggested to build a new sybase server with UTF-8 charset due to sensitvity of sybase with respect to char sets.

    2) Then load the iso char set databases into UTF-8 database.

    3) You may see some characters which looks to be junk in the database and they can be cleaned up in case application is sensitive to those issues.

    We have tested this methodolgy and works good.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 11, 2015 at 10:39 PM

    The steps that are missing from the various replies in this thread is how to figure out the value to specify for 'default character set id' and 'default sortorder id'.

    To see the available character sets, run this query:

    select id, name, description from master..syscharsets where type < 2000

    (if the desired charset is not shown, use the 'charset' client program to load it)

    To see the available sort orders:

    select id, csid, name, description from master..syscharsets where type >= 2000

    (here, csid is the 'id' value from the previous query which you specified for 'default character set id'

    In my ASE server, I'm using character set ID = 190 and sort order id = 24 for UTF8 with utf8bin sort order. Make sure to verify the correct values in your server.


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.