PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Overview
  • Defining the character set of a data file
  • Defining the character set used by a data file
  • Notes and limitations
  • Example: Creating a data file in Hebrew
  • Changing the character set of a data file
  • Modifying the character set used for the searches and for the sorts
  • Finding out the character set of a data file
  • How to proceed?
  • Example: Changing the fonts according to the character set of the data file read
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
When an application is used to display or save data in HFSQL files, this data is entered in the current language.
If the application is used in a country that uses a Latin character set, no specific management is required.
If the application is used in a country that uses a specific character set, this character set must also be supported by the data files. Therefore, most of the operations (searches, sorts, ...) will be performed according to the selected character set.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
Defining the character set of a data file

Defining the character set used by a data file

To define the character set used by a data file:
  1. Define the character set with ChangeCharset.
  2. Create the data file with HCreation (or HCreationIfNotFound). In these functions, use the hChangeCharset constant to take into account the character set specified by ChangeCharset.
All the functions used to perform sorts and searches will use the specific features of the selected character set.

Notes and limitations

  • The size of string items specified in the analysis is expressed in bytes and not in characters. Depending on the character set used, you may have to increase the item size (if the characters used are coded on 2 bytes for example).
  • The character set of the data file must always be identical to the character set specified by ChangeCharset. Otherwise, when accessing a string index (string, character, date, time):
    • Reading and seeking a record: no error will be displayed. However, the data read will not correspond to the expected data.
    • Modifying a record (addition, modification, deletion of a record or crossed record): a WLanguage error will be displayed.
  • No query with joins can be performed on text items that use different character sets.
  • The sort order in the HFSQL indexes does not take the "doubles letters" into account (CH in Spanish or LJ in Croatian for example).
  • HFSQL Client/Server In HFSQL Client/Server, only the sort order of the following languages is supported: French, Arabic, Chinese, Korean, Estonian, Greek, Hebrew, Japanese, Polish, Russian, Thai, Turkish and Vietnamese.

Example: Creating a data file in Hebrew

// Langue utilisée dans l'application: l'Hébreu
Nation(nationHebrew)
// Changement d'alphabet
ChangeCharset(charsetHebrew)
// Création du fichier de données
// avec prise en compte du changement d'alphabet
HCréation(Azaa, "", "", "", hChangeCharset)
// Saisie d'un enregistrement
Azaa.toto = "ñéâëðéçìòëðâëêðéò"
HAdd(Azaa)
Changing the character set of a data file
In some cases, you may want to change the character set of a data file without re-creating this file. For example:
  • a data file was translated.
  • a data file is filled when installing an application with the data corresponding to the setup language.
  • ...

Modifying the character set used for the searches and for the sorts

To modify the character set used for the searches and for the sorts:
  1. Specify the character set to use with ChangeCharset.
  2. Re-index the data file with HIndex. Use the hChangeCharset constant to take into account the character set specified by ChangeCharset.
Finding out the character set of a data file

How to proceed?

To find out the alphabet used by a data file, use the Property Alphabet on the desired the data file HFSQL.

Example: Changing the fonts according to the character set of the data file read

HOpen(Client)
LangueFichier is int = Client.Alphabet
// Change l'alphabet affiché en fonction du format du fichier de données
SWITCH LangueFichier
CASE charsetArabic: ChangeCharset(charsetArabic)
CASE charsetDefault: ChangeCharset(charsetDefault)
CASE charsetGreek: ChangeCharset(charsetGreek)
CASE charsetHebrew: ChangeCharset(charsetHebrew)
CASE charsetOccidental: ChangeCharset(charsetOccidental)
CASE charsetRussian: ChangeCharset(charsetRussian)
CASE charsetTurkish: ChangeCharset(charsetTurkish)
OTHER CASE
// On passe en caractère occidental
  ChangeCharset(charsetOccidental)
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment