The problem with the "it just works" approach is that it only 'just works' 98% of the time. For a large number of people that will be close enough to 100% that they won't even notice the 2%, but if/when you do run into that 2% the fact that you haven't had to understand or adapt anything leaves you high and dry when it comes to understanding what's going wrong, how and how to fix it.<br>
<br>All those oh-so-convenient automatic codepage conversions going on behind the scenes are great, except when they are either unnecessary and merely serve to exact a performance penalty you could do without, or actually cause problems because your code knows better than the compiler what it is doing and the compiler doesn't even take cues from your code to figure out what *it* should be doing that you think your code already *told* it to do so ends up doing what you don't expect but not telling you.<br>
<br>Not to mention the wholly confusing plethora of string related RTL routines that we now have to live with.<br><br>Need to convert a Unicode string to Uppercase ? That would be ANSIUppercase() then, obviously. Or ToUpper(). But to use ToUpper() you have to turn your back on pre-Unicode compilers since it is wholly new and lives in a newly introduced "Character" unit (why the contents of this unit couldn't be added to StrUtils is anybody's guess).<br>
<br>So on the one hand, they went to all this effort to enable a "seamless transition" to Unicode, but then to write Unicode handling code that _actually_makes_sense you still have to make changes that amount to a NO-OP, but you have to go searching for areas where these changes might be desirable because the compiler will just continue compiling your old, non-Unicode sensible code anyway.<br>
<br>A recipe for a great "open an old project and recompile" experience (i.e. demo's), at the expense of a head-numbing, wall-denting "maintenance of existing code especially where needed to share between pre and post Unicode compilers" experience.<br>
<br>imho. ymmv.<br><br>Your file streaming example is a good case in point: "So I can recompile and my project is automatically Unicode throughout? 'It Just Works' - GREAT!!" ... time passes ... "Hey, how come my file output is still not Unicode ? What happened to 'it just works' ?" (then there's db schemas that won't automatically "unicodify" on their own, but you code will "just work" regardless).<br>
<br>The way they did the upgrade is convenient, but it's not consistent (there may be reasons for the inconsistencies but they are still inconsistencies). In fact I seem to recall having seen a stackoverflow question that involved this stream/stringlist encoding behaviour only earlier this week. <br>
<br><br>[ disclosure: I have projects which deal with what most people would consider very low level string handling and characteristics, so my experience may be somewhat of a niche, but ime when the foundations are shaky the wobbles are very often felt throughout the building even if it's only the basement engineers that actually see the problems. Those on the top floor might even think the wobbles they occasionally feel are caused by the wind - :) ]<br>
<div><br><div><br><div class="gmail_quote">On 4 October 2012 09:06, John Bird <span dir="ltr"><<a href="mailto:johnkbird@paradise.net.nz" target="_blank">johnkbird@paradise.net.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" lang="EN-NZ" vlink="purple" link="blue">
<div dir="ltr">
<div style="FONT-FAMILY:'Verdana';COLOR:#000080;FONT-SIZE:12pt">
<div>Thats one of the advantages of how they did the upgrade – if you use the
same D7 code on XE2/3 and using standard methods of writing to files such as
FileStream or TStringlist.savetofile then you will find that the strings in
memory are Unicode, and saved to disk will be ANSI by default (you have to
specify to save as Unicode as a format to get it). ie it is pretty
close to “it just works”. Source code similarly remains ANSI until you
start saving Unicode strings – in that case it automatically switches to
unicode.</div></div></div></div></blockquote></div></div></div>