🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Unicode Characters

#825
From: Paul Kienitz
Date: Thu, 06 Jun 2002 08:06
25 lines
2241 bytes
Andrew Woodall wrote:

> Does anybody know how to use Unicode characters in C++ Builder??
>
> I want to use the infinity symbol, but when inserting it either into code in
> the IDE or into the caption of a label or button, a question mark appears
> instead.
>
> Is there a way to do this???

Borland fights back pretty hard against any attempt to make it do unicode.  For
instance, I found that wide-character literal escapes in the form of  L"\x3333"
do not work, either in the C++ compiler or in the resource compiler.  What I
ended up doing was using RCDATA blocks in the resource, which meant that all my
unicode strings had to be encoded like this:

SOME_STRING RCDATA { 0x30D5, 0x30A1, 0x30A4, 0x30EB, 0x540D, 0x3A, 0 }

Then I made a generalized string loader which, when given an ID, would first
look for an RCDATA and, if that was not found, look for a string resource.  All
control captions had to be assigned at runtime.

Oddly, though, the .DFM files are able to support unicode, I believe.  They use
UTF-8 encoding.  The gotcha is that they will probably lose the information if
you ever use the design-time editors, which are limited to 8 bit characters.
Technical Details
Message-ID: <3CFF1810.2F630FF5@prevaluate.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!usenetserver.com!gestalt.direcpc.com!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.icl.net!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3cf63842_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10297d,7180af617176311f
X-Google-Attributes: gid10297d,public
X-Google-ArrivalTime: 2002-06-06 01:14:04 PST
Message-ID: <3CFF1810.2F630FF5@prevaluate.com>
Date: Thu, 06 Jun 2002 01:06:40 -0700
From: Paul Kienitz <pkienitz@prevaluate.com>
X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internationalization
Subject: Re: Unicode Characters
References: <3cf63842_2@dnews>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 65.45.176.183
X-Trace: dnews 1023350800 65.45.176.183 (6 Jun 2002 01:06:40 -0700)
Lines: 26
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!usenetserver.com!gestalt.direcpc.com!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.icl.net!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews