Accuracer: The First And Only BDE Alternative
Client-Server Single-File Embedded Database for Delphi / C++Builder / Kylix



Internationalization and localization

Previous  Top  Next


Introduction

This topic discusses guidelines for writing applications you plan to distribute to an international market. By means of the ahead planning, you may reduce the amount of code and time necessary to make your application operate in its foreign market as well, as it does in its domestic market.

Some things you should know for writing international applications with Accuracer.

Currency, float numbers and date/time format

Sometimes you have to convert Currency, Date/Time or float value to string. For example if you need to set Filter property of Accuracer for condition like 'Birthday=01/01/1970'.
Accuracer always uses current values of DateSeparator, TimeSeparator and DecimalSeparator.
So you should use DateToStr/TimeToStr or FloatToStr functions to get converted date/time or float value.

Locale and strings sort order

You may use the IndexName and IndexFieldNames properties to set the current index order, and consequently, sort the current table based upon the index definition for the selected index order.
However sorting order for strings depends on current system/user locale and it is specific for various languages.
Accuracer uses locale specific string operations, so if you use ftString data type then all records being sorted by this field will be sorted using current system locale.
If you want to support Asian languages you should use Unicode character set.

Unicode support

In the Unicode character set, each character is represented by two bytes. Thus a Unicode string is a sequence of two-byte words, not individual bytes. Unicode characters and strings are also called wide characters and wide character strings. The first 256 Unicode characters map to the ANSI character set.
Accuracer implements Unicode support through the ftWideString data type.

The following example shows how to set and get data of Unicode field.

var ws: WideString;
with MyAccuracer do
begin
//
get data from Unicode field
ws := FieldByName('Unicode').Value;
// do something with data in ws
ws := 'example string';
// set data to Unicode field
Insert;
FieldByName('Unicode').Value := ws;
Post;
end;

WideMemo fields can be accessed using TACRDataset methods SetWideMemoField and GetWideMemoField:

var ws: WideString;
with MyAccuracer do
begin
// do something with data in ws
ws := 'example string';
// set data to Unicode field
Insert;
SetWideMemoField(FieldByName('Unicode'), ws);
Post;
// get data from Unicode field
ws := GetWideMemoField(FieldByName('Unicode'));
end;

Note:
Wide string fields can be used only with Windows versions that supports CompareStringW function (NT, 2000, XP, 2003). Windows 9x, Me does not support wide strings.


© AidAim Software Accuracer: