<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tt/onlinemanual/lan_character_sets" xml:lang="en">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Character sets</Title>
		<Keyword ContextSensitive="No"><Level1>Language support</Level1>
			<Level2>character set</Level2>
		</Keyword>
	</Header>
	<GeneralSection><Paragraph class="Default">A character set is a set of alphabetic or other characters used to construct the words and other elementary units of (a) native language(s).</Paragraph>
		<Paragraph class="Default">During the installation of the Infor ERP LN application you must choose a character set. So only one character set applies for the whole ERP LN environment. Therefore only those languages can be stored which are supported by the character set that was chosen.</Paragraph>
		<List><ListIntro>You can choose the following character set types:</ListIntro>
			<ListItem>single byte character sets</ListItem>
			<ListItem>multi-byte character sets</ListItem>
			<ListItem>Unicode character set</ListItem>
		</List>
	</GeneralSection>
	<GeneralSection><SectionTitle>Single byte character sets</SectionTitle>
		<Paragraph class="Default">Single byte character sets only need one byte to store the character information. As a consequence max 256 characters are available. The ISO 8859 standard defines several characters sets, also called locales, to cover the characters of mainly the European languages.</Paragraph>
		<List><ListIntro>Examples of single byte character sets are:</ListIntro>
			<ListItem>ISO 8859-1: mainly west European languages like French, German, Italian etc</ListItem>
			<ListItem>ISO 8859-5: supporting Cyrillic languages (Russian).</ListItem>
		</List>
		<Paragraph class="Default">The lower range, character 000 -127, is the same for all ISO 8859 character sets, the upper range character 128 – 255, is specific per locale.</Paragraph>
		<Paragraph class="Default">The alphabet is encoded in the lower range and therefore the English language is supported with each ISO 8859 locale (English does not need any additional characters).</Paragraph>
		<Paragraph class="Default">The sorting is binary based: The sorting is based on the order the characters are defined in the encoding. All upper case alphabetical characters, for instance, are sorted before the lower case alphabetical characters. For example, the ‘Z’ is sorted before the ‘a’.</Paragraph>
	</GeneralSection>
	<GeneralSection><SectionTitle>Multi-byte character sets</SectionTitle>
		<Paragraph class="Default">Multi-byte characters sets are typically required for languages that have more than 256 characters. A typical example is Chinese. In the context of ERP LN the multi-byte character sets require 4 bytes per character.</Paragraph>
		<List><ListIntro>Examples of multi-byte character sets are:</ListIntro>
			<ListItem>BIG5: Chinese</ListItem>
			<ListItem>Wansung: Korean</ListItem>
		</List>
		<Paragraph class="Default">Sorting is binary based.</Paragraph>
	</GeneralSection>
	<GeneralSection><SectionTitle>Unicode character set</SectionTitle>
		<Paragraph class="Default">The Unicode character set is a standardized character set supporting all (modern) languages. This takes away the limitation of supporting a small set of languages within one ERP LN environment. When you choose Unicode as character set, you can have for example Chinese, English and French in one ERP LN environment.</Paragraph>
		<Paragraph class="Default">Another advantage of the Unicode character set is that it comes with linguistic sorting rules. When the data must be visualized in a sorted form, the data will be shown based on the sorting rules as defined by the ICU standard.</Paragraph>
		<Note><SectionTitle>
                                 Note
                              </SectionTitle>
			<Paragraph class="Default">The ICU standard also defines ‘tailoring’, that is fine-tuning the sorting rules to a specific language, which is not supported by the ERP LN tools.</Paragraph>
		</Note>
		<Paragraph class="Default">As a consequence the database size of a Unicode based ERP LN environment is bigger, and the CPU and memory load on the system are higher than for a multi-byte or single byte based character set. The choice for Unicode is typically made when multiple languages must be supported or when linguistic sorting is a preference.</Paragraph>
	</GeneralSection>
	<GeneralSection><SectionTitle>High Ascii Tolerance</SectionTitle>
		<Important><SectionTitle>
                                 Important!
                              </SectionTitle>
			<Paragraph class="Default">The following only applies to ERP LN environments that do not run in Unicode mode.</Paragraph>
		</Important>
		<List><ListIntro>You must set the <Emphasis>high_ascii_tolerance</Emphasis> resource to 0 in the following situations:</ListIntro>
			<ListItem>If your ERP LN environment is a production environment and you plan to convert the environment to Unicode.</ListItem>
			<ListItem>If your ERP LN environment is a development environment and you plan to deliver software components or translations. If <Emphasis>high_ascii_tolerance</Emphasis> is not set to 0, problems will occur when the delivered components are imported in Unicode environments.</ListItem>
		</List>
		<Paragraph class="Default">To set <Emphasis>high_ascii_tolerance</Emphasis> to 0, add the following line in the <Emphasis>$BSE/lib/defaults/all</Emphasis> file:</Paragraph>
		<Paragraph class="Default"><Code>high_ascii_tolerance:0</Code>
		</Paragraph>
	</GeneralSection>
	<GeneralSection><SectionTitle>The role of the user locale</SectionTitle>
		<List><ListIntro>This section describes the role of the user locale in the following types of installations:</ListIntro>
			<ListItem>single-byte</ListItem>
			<ListItem>multi-byte</ListItem>
			<ListItem>unicode</ListItem>
		</List>
		<GeneralSection><SectionTitle>
                                 Important!
                              </SectionTitle>
			<Paragraph class="Default">It is technically possible to define a different locale for each user ( <GUIRef href="/baanerp/tt/ams/ttams1110m000" role="session">User Data Template (ttams1110m000)</GUIRef> session). However, this can cause problems. Therefore Infor does NOT support the usage of multiple user locales. Consequently all users in an ERP LN environment must have the same user locale.</Paragraph>
		</GeneralSection>
		<GeneralSection><SectionTitle>The role of the user locale in a single-byte installation</SectionTitle>
			<Paragraph class="Default">In a single-byte installation the user locale defines the character set that can be used throughout the application.</Paragraph>
			<Important><SectionTitle>
                                    Important!
                                 </SectionTitle>
				<List><ListIntro>
                                       Infor strongly advises the following:</ListIntro>
					<ListItem>Use a user locale that matches the character set used in the database. In this way “3rd party” database tools can access the data.</ListItem>
					<ListItem>Use a locale that defines a binary sorting order (also known as collation).</ListItem>
					<ListItem>Choose a binary sorting order in the database as well. For example, in West-European countries you can use the ISO_BIN1 locale. The character set of this locale is the same as the ISO-8859-1 locale, but the sorting order is binary.</ListItem>
					<ListItem>Ensure all users have the same user locale. Note that this is not enforced by the tools or porting set.</ListItem>
				</List>
			</Important>
			<List><ListIntro>The user locale has impact on the following:</ListIntro>
				<ListItem>The way data is stored in the database. The user locale determines the code points that are used to store single-byte characters.</ListItem>
				<ListItem>Some bshell (3GL) functions: <List><ListItem>mb.locale.info(), including the TSS_GET_IFACTOR and TSS_GET_EFACTOR aspects</ListItem>
						<ListItem>set.min()</ListItem>
						<ListItem>set.max().</ListItem>
						<ListItem>set.fmin()</ListItem>
						<ListItem>set.fmax()</ListItem>
					</List>
				</ListItem>
				<ListItem>The non-Unicode version of BWPrint, which must convert to the proper Windows code page. Note: to convert data from the ISO locales to Windows code pages, BWPrint uses the _WIN32 versions of the user locale.</ListItem>
			</List>
		</GeneralSection>
		<GeneralSection><SectionTitle>The role of the user locale in a multi-byte installation</SectionTitle>
			<Paragraph class="Default">In a multi-byte installation the user locale defines the character set that can be used throughout the application.</Paragraph>
			<Important><SectionTitle>
                                    Important!
                                 </SectionTitle>
				<List><ListIntro>
                                       Infor strongly advises the following:</ListIntro>
					<ListItem>Use a user locale that matches the character set used in the database. This character set must use a binary sorting.</ListItem>
					<ListItem>Data is stored in the database using the character set of the user locale. Ensure the correct character set is specified for the database, so the database treats the characters in the correct way. In this way “3rd party” database tools can access the data. Otherwise the data could show up garbled.</ListItem>
					<ListItem><Paragraph class="Default">Ensure all users have the same user locale. Note that this is not enforced by the tools or porting set. If users have different user locales, conversion errors occur when a user processes data of another user, who has a different user locale. This mainly impacts processes that write to and read from the database. Consequently the user locale impacts any integration that interacts with the database.</Paragraph>
					</ListItem>
				</List>
			</Important>
			<List><ListIntro>The user locale has impact on the following:</ListIntro>
				<ListItem>The conversion of data from “native” format (MBCS) to TSS and vice versa. The user locale determines the meaning of the term “native”.</ListItem>
				<ListItem>The way data is stored in the database. The user locale determines the code points that are used to store multi-byte characters.</ListItem>
				<ListItem>Some bshell (3GL) functions: <List><ListItem>mb.import$(). This function converts data from “native” format to TSS.</ListItem>
						<ListItem>mb.export$(). This function converts data from TSS to “native”.</ListItem>
						<ListItem>utf8.export$(). The BaanIV porting set uses the “native” format as intermediate format to convert from TSS to UTF-8. If the user locale does not match with the data, this can result in conversion errors.</ListItem>
						<ListItem>mb.width(). This function returns the width of a string, where width is defined in “number of display positions”. For example, in the ISO8859n character sets, the “LATIN SMALL LETTER E WITH ACUTE” character takes 1 display position. However, in the GB2312 character set, it takes 2 display positions.</ListItem>
						<ListItem>mb.locale.info(), including the TSS_GET_IFACTOR and TSS_GET_EFACTOR aspects.</ListItem>
						<ListItem>set.min()</ListItem>
						<ListItem>set.max()</ListItem>
						<ListItem>set.fmin()</ListItem>
						<ListItem>set.fmax()</ListItem>
					</List>
				</ListItem>
				<ListItem>The appearance of log messages. The text in log messages is converted from the TSS character set to “native” format.</ListItem>
				<ListItem>The non-Unicode version of BWPrint, which must convert TSS data to “native” format.</ListItem>
			</List>
		</GeneralSection>
		<GeneralSection><SectionTitle>The role of the user locale in a Unicode installation</SectionTitle>
			<Paragraph class="Default">Since the introduction of the Unicode character set, the role of the user locale has become less important. In a pure Unicode environment all characters are represented by unique code points. All code points have a unique interpretation. However, there are still some areas where conversions from and to Unicode occur.</Paragraph>
			<ExampleSection><SectionTitle>
                                    Example
                                 </SectionTitle>
				<Paragraph class="Default">You work in a Unicode environment. However, your personal user locale is ISO8859. You want to exchange data between the Unicode environment and another environment. When you perform an export from the Unicode environment, for example through ERP LN Data Director or EDI, the export files are in ISO8859 format.</Paragraph>
			</ExampleSection>
			<List><ListIntro>The user locale has no impact on the following:</ListIntro>
				<ListItem>The way data is stored in the database. All data in multi-byte columns is stored in Unicode. The data in single-byte columns is stored “as is” in Unicode; effectively it is interpreted in the ISO-8859-1 locale. For example, the “LATIN LETTER A” is stored as Unicode code point 0x41. The code point 0x9e is stored as the Unicode code point 0x9e, which represents the “LATIN SMALL LETTER E WITH ACUTE” character (é).</ListItem>
				<ListItem>The normal operation of the bshell. This excludes the following functions: <List><ListItem>Conversion functions, such as mb.export$() and mb.import$().</ListItem>
						<ListItem>Functions to acquire information about the current user locale, such as mb.locale.info().</ListItem>
					</List> Note: The following functions are <Emphasis>not</Emphasis> impacted by the user locale: <List><ListItem>set.min()</ListItem>
						<ListItem>set.max()</ListItem>
						<ListItem>set.fmin()</ListItem>
						<ListItem>set.fmax()</ListItem>
					</List>
				</ListItem>
				<ListItem>The appearance of log messages. The text in log messages is converted from UTF-T to UTF-8 format.</ListItem>
				<ListItem>The Unicode version of BWprint.</ListItem>
			</List>
			<Paragraph class="Default">The user locale has a small impact on the dump files as created by the bdbpre utility. Data in the bdbpre-dump files is in the UTF-8 character set. If the database contains “high ascii” characters, these characters are converted in the context of the current user locale. Note that the <Emphasis>high_ascii_tolerance</Emphasis> resource has no effect on this process. For details, refer to the comment on the conversion of “high ascii” characters below.</Paragraph>
			<List><ListIntro>The user locale has impact on the following:</ListIntro>
				<ListItem>The conversion of data from “native” format (MBCS) to Unicode (UTF-T) and vice versa. The user locale determines the meaning of the term “native”.</ListItem>
				<ListItem>The conversion of so-called “high ascii” characters. See below.</ListItem>
				<ListItem>Some bshell (3GL) functions: <List><ListItem>mb.import$(). This function converts data from “native” format to UTF-T.</ListItem>
						<ListItem>mb.export$(). This function converts data from UTF-T to “native”.</ListItem>
						<ListItem>mb.width() This function returns the width of a string, where width is defined in “number of display positions”. For example, in the ISO8859n character sets, the “LATIN SMALL LETTER E WITH ACUTE” character takes 1 display position. However, in the GB2312 character set, it takes 2 display positions.</ListItem>
						<ListItem>mb.locale.info(), excluding the TSS_GET_IFACTOR and TSS_GET_EFACTOR aspects.</ListItem>
					</List>
				</ListItem>
				<ListItem>The non-Unicode version of BWPrint, which must convert UTF-T data to “native” format. This can result in conversion errors because the “native” character set supports only a limited subset of UTF-T. Therefore, Infor strongly advises to use the Unicode version of BWPrint in a Unicode installation.</ListItem>
			</List>
			<GeneralSection><SectionTitle>Conversion of “high ascii” characters</SectionTitle>
				<Paragraph class="Default">The occurrence of “high ascii” characters poses a problem, because one code point can have different meanings in different character sets.</Paragraph>
				<ExampleSection><SectionTitle>
                                       Example
                                    </SectionTitle>
					<Paragraph class="Default">In the ISO-8859-1 locale, the code point 0xe9 (decimal 233) is interpreted as the “LATIN SMALL LETTER E WITH ACUTE” character (é).</Paragraph>
					<Paragraph class="Default">In the ISO-8859-7 locale, this code point is interpreted as the “GREEK SMALL LETTER IOTA” character (ι).</Paragraph>
				</ExampleSection>
				<Paragraph class="Default">To determine the meaning of a “high ascii” character, ERP LN uses the current user locale. If the user locale is an ISO8859n variant, then this character set is used to determine the correct meaning; otherwise the ISO85591 character set is used.</Paragraph>
				<ExampleSection><SectionTitle>
                                       Example
                                    </SectionTitle>
					<Paragraph class="Default">The user locale is ISO88597. A string, which contains the 0xe9 code point, must be converted to UTF-T. The code point is interpreted as the “GREEK SMALL LETTER IOTA” character. The resulting UTF-T code point is 0x9bbc87b9.</Paragraph>
					<Paragraph class="Default">The user locale is ISO88591 and the same string must be converted. The code point is interpreted as the “LATIN SMALL LETTER E WITH ACUTE” character. The resulting UTF-T code point is 0x9bbc81e9.</Paragraph>
				</ExampleSection>
				<Paragraph class="Default">
                                    Infor advises to keep the installation clean from “high ascii” characters. To achieve this, set the <Emphasis>high_ascii_tolerance</Emphasis> resource to 0.</Paragraph>
			</GeneralSection>
		</GeneralSection>
	</GeneralSection>
</ManualTopic>
