<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:m =
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=Generator content="Microsoft Word 14 (filtered medium)">
<STYLE><!--
/* Font Definitions */
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas","serif";
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
..MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></STYLE>
</HEAD>
<BODY dir=ltr lang=EN-US bgColor=white vLink=purple link=blue>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Arial'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>I am converting source to be D2007 and XE2 compatible, the main issue being
just my own string and file reading functions.</DIV>
<DIV> </DIV>
<DIV>I recall Jolyon writing about this some months ago, with his complaints
about the confusing naming of some of the routines (ANSIUpperCase for
uppercasing Unicode for instance).</DIV>
<DIV> </DIV>
<DIV>From what I have been reading and researching I wanted to add a few points
and list them here to make sure I am on the right track:</DIV>
<DIV> </DIV>
<DIV>1 – Almost everything compiles and runs as is, especially if one has never
tried to cater for WideChar and WideString before (thats where much of the
problems come from IMHO)</DIV>
<DIV> </DIV>
<DIV>2 – Some unusual cases – Records with definitions eg Name:string[60]
will need to be revisited. (these are shortstring and still Ansi).</DIV>
<DIV> </DIV>
<DIV>3 – stringlists etc using SavetoFile and LoadFromFile will default to a
file format of AnsiStrings unless a BOM is found or unless one specifies a
format otherwise</DIV>
<DIV> </DIV>
<DIV>4 – Source files similarly will remain as Ansi/Ascii unless Unicode
characters are present</DIV>
<DIV> </DIV>
<DIV>5 – statements like if ThisChar in [‘a’-‘z’] replaced with
CharInSet (the argument ‘a’-‘z’ is still AnsiChar/Ascii
characters</DIV>
<DIV> </DIV>
<DIV>6 – Uppercase, lowercase and more general string functions like the above
charinset are best replaced with the Character unit functions:</DIV>
<DIV> eg</DIV>
<DIV> isLower</DIV>
<DIV> isUpper</DIV>
<DIV> isDigit</DIV>
<DIV> toUpper</DIV>
<DIV> toLower</DIV>
<DIV> </DIV>
<DIV> these are all general Unicode routines – many for either
Char or String – and handle eg case conversion according to the general Unicode
rules. ie don’t use the AnsiUpperCase function which converts Ascii
and according to the current locale (codepage) – ie not general Unicode
conversion as far as I can figure.</DIV>
<DIV> </DIV>
<DIV>7 – To compare strings, use CompareStr and CompareText for comparison which
is or is not case sensitive according to general Unicode rules.
These also use proper unicode rules I understand so that the same character
encoded differently in each string (eg as a surrogate pair) will be still
matched if it is ultimately the same character.</DIV>
<DIV> </DIV>
<DIV>8 – {$IFDEF UNICODE} blocks can be added for code only for XE2 etc
and will be ignored by D2007.</DIV>
<DIV> </DIV>
<DIV>Hope this research is of use to others, please tell me if any of these are
wrong.</DIV>
<DIV> </DIV>
<DIV style="FONT-FAMILY: 'Arial'; COLOR: #000000; FONT-SIZE: 12pt">John
Bird<BR></DIV></DIV></DIV></BODY></HTML>