International support – PB Docs 70

International support

PowerBuilder provides the following international support:

  • Arabic and Hebrew right-to-left support
    in the Enterprise edition of PowerBuilder on Windows 95
  • Japanese double-byte character set (DBCS) support
    in a separate version of PowerBuilder available on Windows 95 and
    NT
  • Unicode Standard support in a separate version of PowerBuilder available on
    Windows NT 4.x

Arabic and Hebrew support

PowerBuilder Enterprise provides support for the Arabic and
Hebrew languages when run on an Arabic- or Hebrew-enabled version
of Windows 95. On an Arabic-enabled or Hebrew-enabled version of
Windows, you can display text in right-to-left order and test for
Arabic or Hebrew characters in strings.

Functions

The Reverse function takes a string as an argument and returns
the string in reverse order. The following functions take a character
or a string as an argument and return a boolean value:

Function Returns TRUE if
IsArabic The character is an Arabic character
IsAllArabic All characters in the string are Arabic
characters
IsArabicAndNumbers All characters in the string are Arabic
characters or numbers
IsAnyArabic Any character in the string is an Arabic
character
IsHebrew The character is a Hebrew character
IsAllHebrew All characters in the string are Hebrew
characters
IsHebrewAndNumbers All characters in the string are Hebrew
characters or numbers
IsAnyHebrew Any character in the string is a Hebrew
character

note.gif Platform information These functions only work if the operating system is a right-to-left
enabled version of Windows.

EditMask character

A character (b) in the EditMask control allows the entry of
Arabic or Hebrew characters. You will usually use this mask when
you need a single letter prefix for an ID or when you need a single
character entry. The EditMask control does not have a RightToLeft
property and does not support right-to-left text entry; all text
is entered left to right.

RightToLeft property

The Window object has a RightToLeft property that you can
set programmatically or on the General property page for the window.
When this property is TRUE, characters are displayed in right-to-left
order. The application must be running on a Hebrew or Arabic version
of PowerBuilder under an operating system that supports right-to-left
display.

The Application object also has a RightToLeft property that
you can set programmatically. This property does not display on
the Application object property sheet. When this property is TRUE,
MessageBox text displays right-to-left.

note.gif What the Application object’s RightToLeft
property affects
When running under a right-to-left enabled version of Windows,
setting the Application’s RightToLeft property to TRUE
displays message text right-to-left, but it has no effect on the buttons
in
the MessageBox. The buttons will display left-to-right and the button
text will be in English. The buttons in the MessageBox only display
in Arabic or Hebrew if you are using a localized version of Windows.

Deployment

Applications built using the Arabic and Hebrew features in PowerBuilder must be
deployed with the PowerBuilder Arabic or Hebrew deployment DLLs on workstations
running the appropriate Arabic-enabled or Hebrew-enabled version
of Windows.

Unicode support

PowerBuilder for Unicode supports the Unicode standard, a
universal character set that encodes the characters of over 650
of the world’s languages. The ability to use a single character
set to encode data in multiple languages allows you to create a
single multilingual application that can process data in different
languages rather than creating multiple monolingual applications.

Every application development tool encodes text in a particular
character set. PowerBuilder for Unicode uses Unicode UTF-16, a two-byte
encoding format. Therefore, any text you enter in developing your
application is in Unicode.

note.gif PowerBuilder for Unicode restrictions Most of the features in the Enterprise edition of PowerBuilder are
supported in PowerBuilder for Unicode. For a list of unsupported features
and restrictions, see the release notes or the online Help provided
with PowerBuilder for Unicode.

Naming

To avoid naming conflicts between PowerBuilder for Unicode and
the ANSI version of PowerBuilder, PowerBuilder for Unicode uses a PowerBuilder initialization
file called PBU.INI, PowerBuilder libraries created or saved using PowerBuilder for
Unicode have the file extension .PUL, and PowerBuilder for Unicode
DLLs are identified by a letter U at the end of the name (as in
PBVM70U.DLL).

Fonts

Some fonts do not display Unicode characters correctly or
do not work appropriately on all PowerBuilder platforms. To ensure
that the best font is used, at startup PowerBuilder (or the PowerBuilder runtime)
checks that the Tahoma font is available and, if necessary, sets
the font used by PowerBuilder to Tahoma in the Windows registry. If
Tahoma is not available, the font is mapped to Arial. The fonts
used in title bars and menus are determined by the system, so each
user should specify a font that supports Unicode characters (such
as Lucida Sans Unicode) for title bars and menus on the Appearance
tab in the Windows Control Panel Display Properties dialog box.

External function calls

If you call external functions in your application, the functions
must be defined and compiled with Unicode support. All strings must
be passed as Unicode strings. If you call Windows API functions,
use the Unicode version of the function name. For example, use FindWindowW
(W for wide) instead of FindWindowA (A for ANSI).

Deployment

You must deploy applications built with PowerBuilder for Unicode
with the Unicode deployment DLLs on Windows NT 4.x. You can run
applications created in PowerBuilder for Unicode on any language version
of Windows NT 4.x without modification. The Unicode deployment DLLs
are included with PowerBuilder for Unicode.

Converting applications in PowerBuilder for Unicode

You can convert an ANSI PowerBuilder application to a Unicode
application and vice versa. You must use PowerBuilder for Unicode
to perform both conversions.

note.gif Unicode characters If you add characters to an application in PowerBuilder for
Unicode that are not supported in the ANSI version, the characters
will not convert correctly.

proc.gif To convert an ANSI PowerBuilder application to Unicode:

  1. Select File>Select Application
    from the menu bar.

  2. Select the application you want to convert from
    the Convert tab.

    note.gif Selecting applications The Browse tab in the Select Application dialog box lists
    only PULs. The Convert tab lists only PBLs.

    If you know the name of the application you want to convert
    and the name and location of the PBL, you can enter it in the Name
    box. For example:

  3. Click OK.

    PowerBuilder opens the Convert Application dialog box.

  4. If you want to convert additional libraries, click
    the Browse button to specify them, then click OK.

    PowerBuilder for Unicode converts the specified PBLs and saves
    them in the same directory with the file extension .PUL. It does
    not overwrite the original .PBL files.

proc.gif To convert a Unicode PowerBuilder application to
ANSI:

  1. In the Library painter, select the library
    you want to convert and select Design>Convert to ANSI from
    the menu bar.

    PowerBuilder opens the Convert Application dialog box.

  2. If you want to convert additional libraries, click
    the Browse button to specify them, then click OK.

    PowerBuilder for Unicode converts the specified libraries and
    saves them in the same directory with the file extension .PBL. It
    does not overwrite the original .PUL files. The library painter
    displays only PUL files, so the converted ANSI application does
    not display.

File handling in PowerBuilder forUnicode

Unicode files have two extra bytes at the start of the file
to indicate that they are Unicode files. This section summarizes
how PowerBuilder for Unicode handles Unicode and ANSI file formats.

PowerBuilder resource files

PowerBuilder resource files (PBRs) can be in either the Unicode
or ANSI file format.

Reading and writing files

In line mode, the PowerScript FileOpen, FileRead, and FileWrite
functions can open, read, and write to both Unicode and ANSI files.
If the file does not exist, FileOpen creates a Unicode file. The
format in which FileWrite appends data to a file depends on the
format of the data, not the format of the file. If you append a
string entered in PowerBuilder for Unicode to an ANSI file, it is written
as a Unicode character string.

In stream mode, FileOpen, FileRead, and FileWrite assume that
any file is a binary file. FileOpen opens the file as a binary file
and FileWrite writes it as a binary file. To read a file as ANSI
or Unicode in stream mode, you must use the new ToANSI and ToUnicode
functions, which enable conversion to and from Unicode characters.

Script view and file editor

In PowerBuilder for Unicode, the Script view and the file editor
accept both Unicode and ANSI file formats. New scripts and text
files are saved in the Unicode file format.

Writing to initialization files with SetProfileString

The SetProfileString function uses Windows profile calls to
write data to the initialization file. These calls write out the
file in the format, ANSI or Unicode, in which it was opened. To
write Unicode characters to an initialization file, open and save
the file as Unicode before calling SetProfileString.

Library painter

PowerBuilder for Unicode allows you to import both ANSI and
Unicode files in the Library painter. However, you can only export
files in Unicode format. To convert a Unicode file to an ANSI file,
use the ToANSI function in ANSI PowerBuilder.

DataWindow controls

You use the ImportFile function to import data into a DataWindow
control from a tab-delimited text (.TXT) file or a dBase format
2 or 3 (.DBF) file.

File type File format to be imported
.TXT Only Unicode files can be imported in PowerBuilder for
Unicode. Unicode files cannot be imported into ANSI versions of PowerBuilder
.DBF Files created using either the ANSI or
Unicode version of PowerBuilder can be imported into both versions

You use the SaveAs function to save the contents of a DataWindow
control to one of several file formats. The following table summarizes
whether the file formats differ, specifically how character strings
are handled and whether files are marked as Unicode files when they
are saved in PowerBuilder for Unicode:

File type Format of saved file Unicode file
CSV! Comma-separated values saved as Unicode
strings
Yes
dBASE2!, dBASE3!, DIF!, Excel!, Excel5!,
SYLK!, WKS!
Character strings saved as ANSI strings
HTMLTable! HTML syntax saved as Unicode string Yes
PSReport! Only accessible in the version of PowerBuilder (ANSI
or Unicode) in which it was saved
SQLInsert! SQL syntax and data values saved as Unicode
strings
Yes
Text! Text saved as Unicode strings Yes
WMF! Same in the ANSI or Unicode versions
of PowerBuilder

Japanese DBCS support

The Japanese DBCS version of PowerBuilder is compiled under
Japanese Windows and is available as a separate executable for the
Japanese versions of Windows operating systems. In the Japanese
version of PowerBuilder, text in the graphical user interface and
everything you type in displays in Japanese, and the string-handling
functions are double-byte aware.

Migration

You can migrate applications from the ANSI version of PowerBuilder to
the Japanese version. If you add characters that are not supported
in the ANSI version, they will not convert correctly if you migrate
from Japanese to ANSI.

Deployment

You must deploy applications built with the Japanese DBCS
version of PowerBuilder with PowerBuilder Japanese deployment DLLs on
Japanese Windows.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x