|
PowerBuilder libraries (PBLs) contain a header, source code for the objects in the PBL, and binary code. There are two differences between PowerBuilder 10 PBLs and PBLs developed in earlier versions of PowerBuilder:
- The source code in PowerBuilder 10 PBLs is encoded in Unicode (UTF-16LE, where LE stands for little endian) instead of DBCS (versions 7, 8, and 9) or ANSI (version 6 and earlier).
- The format of the header lets PowerBuilder determine that it uses Unicode encoding. The header format for PowerBuilder 10 is the same as that used for PUL files in PowerBuilder 6.5 and for PKL files in Pocket PowerBuilder. These files do not need to be converted to Unicode when they are migrated to PowerBuilder 10.
When PBLs are migrated
Before opening a PBL, PowerBuilder checks its header to determine whether or not it uses Unicode encoding. PBLs are not converted to Unicode unless you specifically request that they be migrated.
You cannot expand the icon for a PBL from a previous release in the Library painter. To examine its contents, you must migrate it to PowerBuilder 10.
When you attempt to open a workspace that contains targets from a previous release in PowerBuilder 10, the Targets to be Migrated dialog box displays. You can migrate targets from this dialog box, or clear the No Prompting check box to open the Migrate Application dialog box.
The Migrate Application dialog box
The Migrate Application dialog box lists each PBL that will be migrated and lets you choose the type of messages that display during the migration process.
Always back up your PBLs before migrating Make sure you make a copy of your PBLs before migrating. After migration, you cannot open them in an earlier version of PowerBuilder.
A new check box, Convert DBCS String-Manipulation Functions, has been added to this dialog box. If you select this check box, PowerBuilder automatically makes appropriate conversions to your scripts. For example, if you used the LenW function, it is converted to Len, and if you used the Len function, it is converted to LenA. This box should be selected only in DBCS environments. For more information, see "String-related functions".
If you click OK, each PBL is first migrated to the new version of PowerBuilder, as in previous releases. Then PowerBuilder converts the source code from DBCS to Unicode, performs a full build, and saves the source code back to the same file. It also appends the argument ;ansi to the declaration of external functions that pass a string as an argument or return a string. For more information about these changes, see "Converting strings to and from Unicode" and "Calling external functions".
Adding PBLs to a PowerBuilder 10 target
When you add PBLs from a previous release to a PowerBuilder 10 target's library list, the PBLs display in the System Tree. As in previous versions of PowerBuilder, the PBLs are not migrated when you add them to the library list. In PowerBuilder 10, their contents do not display because they have not yet been converted. To display their contents, select Migrate from the target's pop-up menu.
Encoding in PowerBuilder text files
PBW and PBT files are not affected by migration—they continue to use ANSI encoding. PBR files can use ANSI or Unicode encoding.
PowerBuilder 10 JSP targets accept JSP files with ANSI, UTF-8, or UTF-16 encoding. The Conversion of ANSI and UTF-8 encoding to UTF-16 encoding takes place automatically when the JSP files are imported to a JSP target.
Code changes might be needed
When you convert an application from ANSI or DBCS to Unicode, you might need to make some changes in your code. For example, see:
|