ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Multilingual functions
  • How to use a specific character set?
  • Changing the character set used by the fonts
  • Changing the character set used by the operations performed on the character strings
  • Changing the character set control by control
  • Using the charsetUTF8 constant
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
Retrieves and/or changes the character set used:
  • by all the screen fonts.
  • by all the operations performed on the character strings (functions and/or operators).
This function allows you to manage all the languages that use specific character sets. The change of character set will be taken into account during the next opening of a window or page. We advise you to close and to re-open all the windows or pages.
Remark: The different fonts are available in different character sets. For example, the "Arial" font exists in the western character set as well as in the Greek or Hebrew character set.
WINDEVReports and QueriesUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadApple WatchJavaUser code (UMC)
// Change the display language of application to Chinese
// Sub-language : Macau (5)
// Sort mode: bopomofo standard (3)
Nation(nationChinese)
// Modify the character set
ChangeCharset(charsetChinese, languageChinese, 5, 3)
// Redisplay the "WIN_Window1" window
Use(WIN_Window1)
WEBDEV - Server codeAjax
// Change the display language of application to Chinese
// Sub-language : Macau (5)
// Sort mode: bopomofo standard (3)
Nation(nationChinese)
// Modify the character set
ChangeCharset(charsetChinese, languageChinese, 5, 3)
// Redisplay the "PAGE_Page1" page
PageUse(PAGE_Page1)
Syntax

Modifying the character set to use Hide the details

<Result> = ChangeCharset(<New charset> [, <Language> [, <Sub-language> [, <Sort mode>]]])
<Result>: Integer constant
Constant identifying the character set used before the modification.
<New charset>: Integer constant
Constant corresponding to the new character set to use:
charsetAnsiRoman characters in ANSI standard
charsetArabicArabic characters
charsetBalticBaltic characters
charsetChineseChinese characters (People's Republic of China)
charsetDefaultUses the computer's default character set. No character set is forced.
charsetEastEuropeEastern Europe characters (Polish, etc.)
charsetGreekGreek characters
charsetHebrewHebrew characters
charsetJapaneseJapanese characters
charsetKoreanKorean characters
charsetMacMac Roman character set (used in previous versions of Macintosh).
charsetOccidentalRoman characters in ANSI standard
charsetRussianRussian characters
charsetThaiThai characters
charsetTraditionalChineseTraditional Chinese characters (Republic of Taiwan)
charsetTurkishTurkish characters
charsetUTF8Used to manage the countries with two character sets (Hong Kong) and the countries with no character set defined in Windows (Georgian and Armenian).
charsetVietnameseVietnamese characters
<Language>: Optional Integer constant
New language to use. For more details on these constants, see Correspondence between languages, sub-languages, character sets and nations.
This language must correspond to the specified <New Charset>. Otherwise, a WLanguage error will occur.
This parameter is used to manage the specific features of each country.
<Sub-language>: Optional integer
New sub-language to use. For more details on sub-languages, see Correspondence between languages, sub-languages, character sets and nations.
This sub-language must correspond to the specified <New Charset>. Otherwise, a WLanguage error will occur.
This parameter is used to manage the specific features of each country.
AndroidAndroid Widget Java This parameter is ignored.
<Sort mode>: Optional integer
New sort mode to use. Only the following sort modes are available. This parameter is not available for the other languages.
LanguageSort mode
ConstantValueSortValue
languageGerman7Standard0
Directory1
languageChinese4Phonetic0
Unicode1
Stroke count order2
Bopomofo standard3
languageKorean18KSC0
Unicode1
languageGeorgian55Standard0
Modern1
languageHungarian14Standard0
Technical1
languageJapanese17XJIS0
Unicode1

AndroidAndroid Widget Java This parameter is ignored.

Retrieving the character set currently used Hide the details

<Result> = ChangeCharset()
<Result>: Integer constant
Constant identifying the character set currently used.
charsetAnsiRoman characters in ANSI standard
charsetArabicArabic characters
charsetBalticBaltic characters
charsetChineseChinese characters (People's Republic of China)
charsetDefaultUses the computer's default character set. No character set is forced.
charsetEastEuropeCharacters of Eastern Europe (Polish, ...)
charsetGreekGreek characters
charsetHebrewHebrew characters
charsetJapaneseJapanese characters
charsetKoreanKorean characters
charsetMacMac Roman character set (used in previous versions of Macintosh).
charsetOccidentalRoman characters in ANSI standard
charsetRussianRussian characters
charsetThaiThai characters
charsetTraditionalChineseTraditional Chinese characters (Republic of Taiwan)
charsetTurkishTurkish characters
charsetUTF8Used to manage the countries with two character sets (Hong Kong) and the countries with no character set defined in Windows (Georgian and Armenian).
Remarks

How to use a specific character set?

To use a specific character set, you must:
  1. Install the files that correspond to the desired character sets in the regional settings of Windows (control panel).
  2. Use ChangeCharset in your program.

Changing the character set used by the fonts

ChangeCharset modifies the character set used by all fonts. The fonts that use the desired character set must be installed on the current computer.
ChangeCharset takes effect immediately. We advise you to close and re-open all the windows or pages.
WINDEVWINDEV Mobile To apply this change to the current window, it is recommended to use Use to force the window to reopen.
WEBDEV - Server code To apply this change to the current window, it is recommended to use PageUse or FramesetUse to display the current window again.

Changing the character set used by the operations performed on the character strings

ChangeCharset modifies the character set used by the operations performed on the character strings. This new character set will be taken into account:
  • when comparing two strings according to the lexicographical order (StringCompare associated with the ccLexicographicOrder constant). This comparison does not take the "double letters" into account (CH in Spanish or LJ in Croatian for example).
  • in the HFSQL indexes (Classic mode or Client/Server mode) once the indexes have been built or rebuilt (HCreation, HCreationIfNotFound or HIndex associated with the hChangeCharset constant). The sort order in the indexes does not take the "double letters" into account (CH in Spanish or LJ in Croatian for example).
ChangeCharset takes effect immediately. We advise you to close and re-open all the windows or pages.
WINDEVWINDEV Mobile To apply this change to the current window, it is recommended to use Use to force the window to reopen.
WEBDEV - Server code To apply this change to the current window, it is recommended to use PageUse or FramesetUse to display the current window again.

Changing the character set control by control

You can also change the character set used control by control with the FontCharset property.

Using the charsetUTF8 constant

The charsetUTF8 constant is used to manage the countries with two character sets (Hong Kong) and the countries with no character set defined in Windows.
In this mode, if a Latin character set is used, the accented characters are not coded on one byte but on several bytes. A character can be coded on 4 bytes.
This operating mode triggers specific effects when managing the character strings.
For example, Length does no longer return the number of characters but the number of bytes corresponding to the string. It is recommended to use UnicodeToAnsi before performing specific operations on character strings.
Component: wd290vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help