rbWiki > General > What's New > RB 11 > Unicode

Unicode

Unicode VCL

RB 11 for Delphi 2009 provides full Unicode support by embracing and leveraging the Delphi Unicode VCL. The Report Designer, Data Access Architecture, RCL, Output Device architecture and Server have all been updated to support Unicode and to provide compatibility for interacting with the surrounding Unicode and Ansi application world.

Prior versions of Delphi declared the String type as AnsiString and mapped windows types and functions to AnsiChar.

// Ansi VCL

String = AnsiString;  

PChar = PAnsiChar;

TextOut = TextOutA;

The Unicode VCL introduces a new UnicodeString type. String is declared as UnicodeString and windows types and functions map to WideChar.

// Unicode VCL

String = UnicodeString;

PChar = PWideChar;

TextOut = TextOutW;

The implications of this are that Delphi 2009 applications are inherently Unicode based. All of the old Ansi string data types and functions are still there, but they are no longer the defaults.

Data Access

Use RB's Data Access architecture to access Unicode and Ansi databases seamlessly. RB automatically converts AnsiString field values to UnicodeString. From the perspective of the DBPipeline AnsiString and WideString field datatypes always map to String (i.e. UnicodeString). This provides simplicity, backwards compatibility for working with Ansi databases, and automatic support for Unicode databases.

AnsiString <--> DataSet <--> DBPipeline <--> UnicodeString 
WideString <--> DataSet <--> DBPipeline <--> UnicodeString 

Use RB's TextPipeline to access Unicode and Ansi text files. Support is provided for several encodings including Ansi, Unicode, Unicode Big Endian, UTF-8, UTF-7, and ASCII. The TextPipeline can auto-detect encodings for files that include a BOM (Byte Order Mark). Files that do not contain a BOM will use the Windows default Ansi encoding - which means by default all of your old text file data will work with no changes. Use the TextPipeline.Encoding property to specify an explicit encoding for Unicode text files that do not include a BOM.

ANSI
Unicode   
Unicode Big Endian
UTF-8
UTF-7
ASCII
 |-------> TextPipeline <---> UnicodeString
Unicode RCL

ReportBuilder's Report Component Libraray (RCL) is an extension of the VCL and is designed to work in a similar manner. For example, the VCL Label.Caption is of type String - which in Delphi 2009 maps to UnicodeString. Likewise, the RCL Label.Caption is of type string - and thus UnicodeString for Delphi 2009.

Report Designer

The RB 11 Report Designer enables creating, saving, and loading report layouts that contain Unicode or Ansi content. You can load reports created with prior RB versions, load reports created with RB 11 for Unicode VCL, and load reports created with RB 11 for Ansi VCL (i.e. RB 11 for D2007 and prior).

The RAP environment includes new Unicode based Code Editor.

The Report Designer user interface can be localized by using either Ansi or Unicode string translations. See next section for details.

String Translations

The ReportBuilder String Translation application has been updated to support Unicode. There are options to generate Ansi or Unicode RC files.

The ReportBuilder for D2009 user interface can be localized by using either Ansi or Unicode string translations.

Delphi 2009 includes two resource compilers. The old BRC32.exe compiler and a newer compiler called RC.exe. We recommend using the RC.exe compiler which supports Unicode and Ansi RC files. The RC.exe compiler auto-detects the RC file encoding.

Report Output

Screen and Printer output for Unicode is provided.

TextFile and ReportTextFile output defaults to UTF-8. Use the Encoding property to specify a different encoding.

Report Server

RB 11 Server Edition utilizes UTF-8 to communication over TCP. The log files are UTF-8 text files.


The RB 11 WebTier produces a UTF-8 encoded XHTML web interface.

Tags
none

Files (0)

 
You must login to post a comment.