🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

TRichEdit and Unicode

#781
From: Steph Reed
Date: Thu, 04 Apr 2002 04:18
45 lines
2453 bytes
Hi All,

I hope this hasn't come up before, but I only seem to have 24 messages
available in this forum. Is it archived anywhere so I can search older
messages?.

I am trying to write a unicode chat application in BCB5, using TRichEdit to
display the text. I can input Chinese text into the TRichEdit, and I can
even cut & paste from other applications, but I can't seem to do anything
with the text.

I wrote a quick test program where I have 2 TRichEdit controls on the form,
and put a button which copies the text from one to the other. The text never
seems to get copied though, and always shows up as ??? in the second
TRichEdit.

I tried copying it in 2 ways, first just

    edit2->Lines = edit1->Lines;

Which didn't work, then I tried

     wchar_t *w;
     int length;

    length = edit1->Text.WideCharBufSize();
    w = new wchar_t[length];
    edit1->Text.WideChar(w, length);

    edit1->Lines->Add(w);

Which also didn't work. I guess I'm probably being really stupid, but I just
can't figure Unicode out with BCB5. I have been trying for weeks now to find
any usefull resources without much luck.

I have found some replacement components (like a new TMemo) that support
unicode, but they never seem to be available for BCB5, only for Delphi5 and
6. Does BCB6 have Unicode aware components?

If any one can help me out with this, or point me in the direction of some
helpfull resouces I would be eternally gratefull.

Thanks,

    Steph Reed
Technical Details
Message-ID: <3cabd41c_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.online.be!news.tele.dk!small.news.tele.dk!128.230.129.106!news.maxwell.syr.edu!cyclone2.usenetserver.com!usenetserver.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10297d,a908dba2ceb2185f,start
X-Google-Attributes: gid10297d,public
X-Google-ArrivalTime: 2002-04-03 20:39:47 PST
From: "Steph Reed" <steph@iconzept.com>
Newsgroups: borland.public.cppbuilder.internationalization
Subject: TRichEdit and Unicode
Date: Thu, 4 Apr 2002 12:18:18 +0800
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 202.85.174.50
Message-ID: <3cabd41c_2@dnews>
X-Trace: dnews 1017893916 202.85.174.50 (3 Apr 2002 20:18:36 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.online.be!news.tele.dk!small.news.tele.dk!128.230.129.106!news.maxwell.syr.edu!cyclone2.usenetserver.com!usenetserver.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews