Default KB language and Database Collation

Official Content
This documentation is valid for:

GeneXus Knowledge Bases can have many languages but only one will be the default. It is specified in the Knowledge Base KBLanguage property.

Every text inserted in the Knowledge Base objects (objects descriptions, attributes descriptions, string inserted in events and rules codes, etc.) will be considered to be in this language. If the KBLanguage value is Spanish and you have this line TextBlock.Caption = "日本語" (Japanese language) in an object events code, the "日本語" literal will be taken as a Spanish literal.

GeneXus Knowledge Bases are stored in a SQL Server database and saves the default language literals in this database tables, so we need to consider setting the appropriate collation in the KB database in order to support the default language characters.

The collation to a new Knowledge Base database can be set when creating it. This is very important because the database collation cannot be changed after the database is created.

Examples

Some known collations are:

English (US) SQL_Latin1_General_CP1_CI_AS
Japanese Japanese_CI_AS
Chinese (PRC) Chinese_PRC_CI_AS
Arabic Arabic_CI_AS
Spanish Modern_Spanish_CI_AS

English (non US)
Portuguese
Italian

Latin1_General_CI_AS

Warning: Always use CI (Case Insensitive) and AS (Accent Sensitive) when selecting your Collation..

For more detail check SQL Server Collation Settings.

Application Database

The same issue happens if you use SQLServer for prototyping your application, make sure to use the correct collation configuration. You can manually create the database with the desired collation as follows:

CREATE DATABASE [DatabaseName]
COLLATE <InsertCorrectCollationHere>
GO

Then, use Create Database command to create the tables.

Troubleshooting

Question Marks ??????? or funny characters is displayed on the generated application

An application is executed and question marks are displayed instead of the correct characters. It could be on the application labels or database values.

image_2019218133710_1_png

This is a hint there is a problem with the KB Database collation or the Application database collation or UTF encoding. Review the case based on this article; once the correct collation is configured characters are correctly seen:

image_2019218133839_1_png

See Also

Working with Collations
Collation and International Terminology
International Considerations for Databases and Database Engine Applications