KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Unicode Mode vs. Compatibility Mode
PRODUCT: 4D Developer | VERSION: 11 | PLATFORM: Mac & Win
Published On: July 2, 2008
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

4D v11 SQL features a new encoding system based on Unicode. In particular, all existing text data is converted into Unicode (2-byte) text when the database is converted.

However, converted databases are not in “Unicode mode” by default. There is a check box in Preferences to ensure compatibility (new 4D v11 SQL databases do not have this option).

The behavior of 4D in "Compatibility mode" is the same as in previous versions of 4D. That is, all text data is treated as if 4D is still using the MacRoman ASCII character set.

This means that, for example, Char (200) will not return the same character with a brand new 4D v11 SQL database as in a converted database with Unicode mode disabled.

In 2004 on Windows, Char(142) will return the é character (from the MacRoman character set). With 4D v11 SQL, this is still true if the “Unicode mode” check box is unchecked. As soon as it is checked, or if you try to copy/paste the character into a brand new 4D v11 SQL database, Char(142) will display a ? and Char (233) will display the é.

In Unicode the é is U+00E9. Notice that E9 in hex = (14*16)+9 = 224+9=233

You will not be able to copy/paste codes like this between a converted database and a brand new database if you are using ASCII codes (i.e. non “Unicode mode”).