Localization allows you to create programs in Lycia that use different character sets and follow specific language rules.
All the data in the compiled programs are stored in Unicode. The source files can be saved with different encoding but during the compilation the pre-processor converts the source files into Unicode, thus achieving the unified encoding for the whole program. This allows you to have source files encoded using different character sets in the same program. The GUI clients always receive and send the data in Unicode. The locale differences manifest only when the connection to a database is established.
Each component included to the 4GL process has to be set up properly, so that the character conversions could be performed correctly from beginning to the end of the chain. The 4GL process starts on the end-user workstation with front-end windows and ends at the database storage files.
The main points of the 4GL process character conversions are as follows:
It is important to remember that database servers usually do not detect that the locale of the database client is not set up properly. That is why no error message is displayed, but the character strings are passed incorrectly. This happens due to the fact that in different code sets one and the same character is represented by different codes, and one and the same code represents different symbols in different code sets.
For example, in CP1252 code set the Latin letter é is represented as 0xE9/233 and as 0x82/130 in CP437. The 233 and 130 are valid codes in both code sets. So, if the database locale is CP1252, 233 will correspond to é and 130 - to a curved quote. If the client application locale is CP437, the é will be encoded as 130 and stored as a curved quote in the database. When the symbol is retrieved from the database, it will be displayed again as é. Therefore, for the front-end user, it will be impossible to see that the data are stored incorrectly in the database.