[DUG] Thai Baht Symbol - or Hex value to String converted
Peter Bankers
peter.bankers at allianceit.co.nz
Fri Aug 3 17:49:27 NZST 2007
Hello Stefan,
My friend from way back.
In fact I believe you were the first person I ever placed in a permanent role.
I trust all is well with you, work and business and Itski.
In my case Im to be GRANDAFATHER or the first time this month. My older daughter is with child and is due to have a baby girl on the 23rd. My wife and I are very excited of course.
OLS DUTCH SAYING:
Its great to be grandfather
only one drawback
Youve got share your bed with GRANDMOTHER!!!
Anyway Stefan, let me how you are doing.
Regards
Peter Bankers
-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On Behalf Of Stefan Mueller
Sent: Friday, 3 August 2007 4:44 p.m.
To: 'NZ Borland Developers Group - Delphi List'
Subject: RE: [DUG] Thai Baht Symbol - or Hex value to String converted
I was just going to mention to forget TMS and go for the free TNTWare
controls ... but looks like they got bought up by TMS software earlier this
year ;-/
Please let me know if you want some old copy of the free component library
(which should still do fine).
I Unicode enabled all my applications - Once you figure out all the snags
and problems (and build a decent library for handling widestrings) it's
actually quite easy to write Unicode enabled applications!
There are however a couple of pitfalls (at least in Delphi7, not sure any of
them got fixed in any of the newer Delphi version and there are plenty more
bugs in any of the older Delphi version in this regard!):
Following is a "DONT DO", Unicode doesn't work from within Delphi source
code:
Label1.Caption := 'symbol (ß)';
Following is also a "DONT DO", because the first string is a normal
ansistring, so the compiler converts implicitly to ansistring:
memo1.Lines.Add('Baht = ' + chr(3647));
(widestring = ansistring + widestring => Fails!)
(widestring = widestring + ansistring => works!)
(widestring = widestring + widestring => works!)
the correct way is to use a Unicode enabled control (like TNTMemo) and use:
tntmemo1.Lines.Add(widestring('Baht = ') + WideChar(3647));
about codepages/Unicode: Windows (even Vista) still uses codepages ... but
the good thing is that Unicode (widestring) is codepage independent - so no
need to get smart and read about codepages (unless you really want to know
why your Delphi application doesn't work)!
Another hint: if you see a "?" then you know you have some
widestring->ansistring->widestring conversion somewhere in your code! - if
you see a empty rectangle box in your display then you know your font is
missing the character to display your Unicode character.
Kind Regards,
Stefan Mueller
_____________________
R&D Manager,
ORCL Toolbox Ltd., Japan
-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On
Behalf Of Steve Peacocke
Sent: Friday, August 03, 2007 12:13 PM
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Thai Baht Symbol - or Hex value to String converted
Hello Brian,
The "uppercase beta" that you are seeing is in fact the character used
for the Baht symbol. See
http://www.fileformat.info/info/unicode/char/0e3f/index.htm
I understand what you are saying, but this will be installed onto a
full hardware sealed-box "device" (I am unable to elaborate on that)
so we have total control over what the user sees whether here in new
Zealand or in Mongolia or anywhere on the planet. Thankfully we are
able to make that definate.
I have ordered the TMS Unicode package (actually the full suite,
should be interesting), so hopefully this will be here shortly and I
can use it. preliminary trials with the downloadable trial components
have, so far, proven successful.
Thanks again.
Steve
--
Steve Peacocke
http://stevepeacocke.blogspot.com/
On 03/08/07, Brian Wrigley <bswrigley at xtra.co.nz> wrote:
> Hi Steve,
>
> ----- Original Message -----
> From: "Steve Peacocke" <steve.peacocke at gmail.com>
> To: "NZ Borland Developers Group - Delphi List" <delphi at delphi.org.nz>
> Sent: Friday, August 03, 2007 8:46 AM
> Subject: Re: [DUG] Thai Baht Symbol - or Hex value to String converted
>
>
> > Except that I can see it rendered on a web page, I can copy that
> > character into MS Word and it shows as a character. I can also copy
> > that character into this email (ß) and it shows correctly (Gmail, on
> > the internet).
>
> By the time that gets to me in Outlook Express, it shows as an uppercase
> beta (chr(223)). Possibly something along the way has converted it to the
> nearest approximation that can be shown on my computer.
>
> Pound, Euro, Yen and a few others are no problem - there are symbols for
> them among the high characters of most of the common fonts. No such luck
> with the Baht. Even if you encode the Baht character correctly (eg in
> Unicode) most people will still only see either a question mark or a
square
> box unless they are using a suitable code page/font choice combination. In
> Thailand they probably do; elsewhere, you might be out of luck.
>
> > Therefore, there should be a way that I can display that character in
> > a Label on a form.
>
> You'd need a label component that uses Widestrings instead of strings, and
> the user would need their machine set up appropriately. Otherwise they'd
see
> question marks or square boxes. You might be better to use a little icon
or
> write the word "Baht".
>
> > Code Pages? A search of both D2007 and D7 help files produce a zero
> > result on this. Can you elaborate?
>
> Joel Spolsky explains the whole mess quite entertainingly here
> http://www.joelonsoftware.com/articles/Unicode.html
>
>
> Brian
>
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject: unsubscribe
Scanned by Bizo Email Filter
Scanned by Bizo Email Filter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.adventureeducation.co.nz/pipermail/delphi/attachments/20070803/8eaf401d/attachment-0001.html
More information about the Delphi
mailing list