views:

204

answers:

1

I have a Delphi + SQL Server (2k or 2005 supported) app that is used by both western and Arabic users. For some fields (i.e. name) my app needs to be able to support both Arabic language and western language characters.

Is it possible to set a single collation & datatype for a field to handle either English or Arabic data? NB: I do not want 2 separate DB's, I want one DB that supports both languages.

+2  A: 

ISO 8859-6 (or its Windows codepage lookalike cp1256) gives you Arabic and Western characters in as much as the lower 128 characters are the same as ASCII. You are out of luck if you want non-ASCII ‘Western’ characters like the accented letters.

Better, though, would be to support all of Unicode. I don't know about Delphi, but in SQL Server you get NVARCHAR, which is your datatype of choice for native Unicode strings. (Stored as UTF-16LE internally.)

bobince
This means Delphi 2009 or greater for Unicode support.
Marcus Adams
@Marcus: thanks. (Wow, it took that long to get Unicode? How depressing.)
bobince
ForerMedia
So...the solution would need to be independent database solutions. What datatypes should I use in code to support western and arabic strings? Cheers
ForerMedia
You can have different character sets (COLLATIONs) on different tables in a single database in SQL Server. However, I think if you're stuck with Delphi 5 (eek!) you're basically all-round screwed. It [appears](http://www.podgoretsky.pri.ee/ftp/Docs/Delphi/D5/dg/intapps.html) it does almost everything using the system code page (“ANSI” character set), so even if you retrieved strings in different encodings from the database, you wouldn't be able to display them.
bobince