🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Multi language support with RC file

#273
From: Leo Saguisag Borland
Date: Sat, 16 Oct 2004 20:41
26 lines
1903 bytes
Baz wrote:

> Try this:
>   UTF8String s=AnsiString::LoadStr(MY_DLL_STRING1);
>   WideString w=UTF8Decode(s);  // convert UTF8 to WideString
>   ShowMessage(w);    // WideString version of ShowMessage
> 
> Notes:
> I assume the project is CLX under BCB6.
> Borland typedef UTF8String to AnsiString in sysmac.h (it's the same
> thing).  The ShowMessage(w) will be the WideString version.
> I also add #include <tchar.h> and add _UNICODE to the project options
> conditional defines to allow _TEXT() or _T() macros.

This will only work if the contents of the .rc file are encoded as
UTF-8 in the first place.  If you have an ANSI string and you call
UTF8Decode you will probably either get an empty string or garbage text.

-- 
Leo Saguisag
Delphi l10n engineer
About the Borland newsgroups: http://info.borland.com/newsgroups/

"Luke, you're going to find that many of the truths we cling to depend
greatly on our own point of view." -- Obi-Wan Kenobi (Return Of The
Jedi)
Technical Details
Message-ID: <41718789$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <416ba1f3$1@newsgroups.borland.com> <417153a6$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10297d,afc63d63b99e1071
X-Google-Attributes: gid10297d,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Leo Saguisag (Borland)" <lsaguisag_at_borland_dot_com>
Subject: Re: Multi language support with RC file
Newsgroups: borland.public.cppbuilder.internationalization
References: <416ba1f3$1@newsgroups.borland.com> <417153a6$1@newsgroups.borland.com>
Organization: Borland Software Corporation
User-Agent: XanaNews/1.16.4.6
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
NNTP-Posting-Host: 10.143.11.214
Message-ID: <41718789$1@newsgroups.borland.com>
Date: 16 Oct 2004 13:41:45 -0700
X-Trace: newsgroups.borland.com 1097959305 10.143.11.214 (16 Oct 2004 13:41:45 -0700)
Lines: 26
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail