Sybase localisation problem

After all these years, Sybase 15 still seems to suffer from some localisation issues.

Today I have installed Sybase 15 on a Red Hat 4 box and changed the language to UTF-8 using the the Sybase "sqlloc" utility.

After running /opt/sybase/, when running isql, it now fails with an error stating the context allocation routine failed when it tried to load the localisation files.

I have seen this problem before and it normally stems from Sybase not recognising the locale that the OS is using (e.g. the $LANG variable). In the past I have either "unset $LANG" to clear out the LANG variable or hacked the Sybase locales.dat file. There are pros and cons, obviously unsetting $LANG means this has to be put in a .profile somewhere so it is executed every time, or I guess I could reconfigure the OS (which might upset some other apps).

Editing the locales.dat means you are modifying the standard Sybase installation, so you need to be aware of this next time you upgrade or re-install Sybase.

For this case, I hacked the locales.dat file by adding an entry for my locale.

From a Unix prompt, I entered:

# echo $LANG

and what came back was:


Next I edited /opt/sybase/locales/locales.dat and found the [linux] section. Towards the end, you will find the following line:

locale = en_US.UTF-8, us_english, utf8

I simply added a new line after this as follows:

locale = en_GB.UTF-8, us_english, utf8

Note that the first part after the "=" matches the locale set in my OS.

isql now seems to work fine. I’m not sure if this is the supported solution, or even if this will have any effect on my apps, but I guess when I find out I will post a note here for you lucky lucky souls!

This entry was posted in Computers and Internet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s