🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internationalization
Article #240

Re: Unicode and LoadString

#240
From: Mark Finkle
Date: Fri, 06 May 2005 13:27
49 lines
3426 bytes
You should definately use TNT (or a library like it) for handling UNICODE in
the UI. Make sure your using WideString versions of function that take or
use strings (TNT includes WideString versions of many VCL functions).

For DB stuff, I know TNT has a Wide string field class and a UTF8 string
field class (I think). Make sure you build your queries using WideString for
everything. Any input from users should come from a TntEdit or TntMemo kind
of control.  Make sure your using a string field class that matches what
your DB supports (true Unicode or UTF8). You could always convert a
WideString to a UTF8String (same as an AnsiString but encoded for non-ASCII
characters), save/load UTF8 to your DB, then convert back to WideString from
UTF8String for using in your application.

Mark Finkle

"kev" <kev@isp.com> wrote in message
news:427a5c25$1@newsgroups.borland.com...
> Andrue,
>
> Thanks for the response.  I am having to internationalize a very large
> existing Builder app.  I should be able to read Unicode strings from a
> language specific dll to populate all Captions, Labels, Menus etc. So as
far
> as your question regarding "how often do I need to display Unicode
strings?"
> The answer is Plenty! In the hundreds. The other, and potentially much
> bigger problem is database access.  My program generates reports with data
> placed into an SQL Server database by other programs written by others on
> the team in VC.  I most likely will have to read at least some strings out
> of the db that are Unicode such as info for report headers like "Work
> Order",  "Customer Name", "Location" etc.
>
> I just wrote a small app to play with and converted a small existing
> database to Access and modified the Work Order field to some Chinese
Unicode
> chars. (BTW - there are several Chinese programmers here).  In access the
> string is fime.  Using Tnt components, I can display the data in a
> TntDBGrid, TntEdit and TntMemo.  Those MIGHT work for me, but I have to
> create Queries based on some of the fields read such as finding all
records
> where the WorkOrder field = "Whatever".  SO now I would have an AnsiString
> part of the query and a unicode part.
>
> How is THAT gonna work???
>
> I have a feeling this is going to be painful!
>
> Thanks again,
> Kev
Technical Details
Message-ID: <427b70c6$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <427905c4$1@newsgroups.borland.com> <4279d5fd@newsgroups.borland.com> <427a1807$1@newsgroups.borland.com> <427a407a@newsgroups.borland.com> <427a5c25$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10297d,94c782bbe2550585
X-Google-Attributes: gid10297d,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mark Finkle" <mark_finkle@nospam.hotmail.com>
Newsgroups: borland.public.cppbuilder.internationalization
References: <427905c4$1@newsgroups.borland.com> <4279d5fd@newsgroups.borland.com> <427a1807$1@newsgroups.borland.com> <427a407a@newsgroups.borland.com> <427a5c25$1@newsgroups.borland.com>
Subject: Re: Unicode and LoadString
Date: Fri, 6 May 2005 09:27:36 -0400
Lines: 52
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 12.4.141.8
Message-ID: <427b70c6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1115386054 12.4.141.8 (6 May 2005 06:27:34 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail