Delphi Handbooks Collection


Delphi XE Handbook


Delphi 2010 Handbook


November 22, 2008

Delphi 2009 White Paper #1: Unicode

CodeGear has publishing on their Developer Network web site the first of a series of white papers I wrote.

CodeGear has publishing on their Developer Network web site the first of a series of white papers I wrote. The topic of this first white paper, which is based on material of my coming Delphi 2009 Handbook, is Delphi and Unicode. You can read the PDF on (or download it from): http://dn.codegear.com/article/38980.

This is the first of five white papers, based on the book, which will cover also improvements in the language, in the IDE, in the VCL, and in DataSnap. Although they are based on material from the book, I've omitted a lot of information on these topics, so that the book has more in-depth coverage. Also the book covers many other topics the white papers ignore. The 5 white papers will be available to anyone, the complete PDF of the ebook only to customers of RAD Studio 2009 (if I understood this correctly), while my book will soon be available to anyone... who buy it <g>.

I'll let you know when the other white papers will be published. BTW, I noticed that Jan Goyvaerts commented on it (and he's a real Unicode expert who did some tech reivew of that portion of the book).

(I don't generally blog on Saturday night, but was busy on Friday after a trip to Trieste and will be traveling on Monday as well...)





 

8 Comments

Delphi 2009 White Paper 1 Unicode 

Will you be selling the ebook as well? I'd prefer to 
have it in MobiPocket format, although PDF would work.
Comment by Giel on November 23, 00:40

Delphi 2009 White Paper 1 Unicode 

Marco,

Thank you for the paper. Your section on 
the "Internal Structure of Strings" was very useful, 
and altered me to what looks like a 12 byte overhead 
(or is it 16 bytes including the ^StrRec) on every 
string.

I just posted a question on StackOverflow: 
http://stackoverflow.com/questions/312118/why-the-
excess-memory-for-strings-in-delphi

Your description could explain the reason for double 
the memory usage. But I'm still at a loss to 
determine why I'm observing triple the memory use.

If you or any of your readers might have an idea, 
please pop over to StackOverflow and post me an 
answer.

In the meantime, I'm looking forward to the CodeRage 
conference and your Delphi 2009 book.
Comment by Louis Kessler [http://www.lkessler.com] on November 23, 07:24

Delphi 2009 White Paper 1 Unicode 

@Kessler: "and altered me to what looks like a 12 
byte overhead (or is it 16 bytes including the 
^StrRec) on every string."
PStrRec = ^StrRec is just a pointer *declaration*, it 
does not use a bit of memory, nor is part of the 
record structure that follows.
Your memory usage looks pretty high, I guess the four 
bytes added to the string management block in not the 
culprit (unless you're using lots of very short 
strings), are you using FastMM in debug mode to track 
leaks? It could be a fragmented heap also, but 
without looking at the code actually is pretty hard 
to tell.


 
Comment by on November 24, 18:03

Delphi 2009 White Paper 1 Unicode 

Marco,

Is there a reason your books are available only in
print format from Lulu.com? I would happily buy both
Delphi 2007 Handbook and Delphi 2009 Handbook (I have
a lot of catching up to do), but only if they were
downloadable. The price is a factor (Delphi is a hobby
for me), as is the instant gratification factor.
Thanks a lot for considering this!

Comment by Marek [] on December 1, 20:42

Delphi 2009 White Paper 1 Unicode 

Marek,

the reason the books are not available in PDF format 
is two fold: (i) I sold the ebook rights to CodeGear, 
(ii) I fear the PDF version will float the web too 
easily. 

This might change in the future, though.
Comment by Marco Cantu [http://www.marcocantu.com] on December 1, 23:18

Delphi 2009 White Paper 1 Unicode 

 Hello Marco,

   You sold the ebook rights to CodeGear, how to get 
it without buying the CodeGear product?
Comment by Ahmad Faisal on December 2, 10:47

Delphi 2009 White Paper 1 Unicode 

 Marco

I have a big problem with Delphi 2009. When I create 
a TstringList the memory is grows but when I Free it 
the usage memory is same. Delphi 2009 does free the 
usage memory. Try I simple test to see it. 
Comment by Abreu [http://www.emc50.com] on February 17, 13:56

Delphi 2009 White Paper 1 Unicode 

Juste a big thank you as your paper was the only one
to really clarify changes from Delphi 2007 regarding
strings, thanks to the numerous tips on the very core
mechanisms.

There's just one answer i didn't find, but maybe
because it doesn't exists : as nowadays many UTF-8
files are BOM-less, is there a convenient way to
figure out the encoding of a text file ? At least if
we restrain the choice to ANSI, UTF-8 and UTF-16 ?

Best regards !

Ninj
Comment by Ninj on June 8, 19:33


Post Your Comment

Click here for posting your feedback to this blog.

There are currently 0 pending (unapproved) messages.