🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: UNICODE: Can't get it to the screen

#769
From: FL
Date: Sat, 23 Mar 2002 15:19
65 lines
3573 bytes
Cut and paste Unicode characters does not work in VCL, because it uses
CreateWindowA to create edit controls. As such, Windows will try to
convert any Unicode codepoint to Ansi using the System codepage. If the
system codepage does not support it, you'll get a question mark. To cut
and paste Unicode characters, use either RichEdit or your own Edit
controls via CreateWindowW. For an example, you may refer to Troy
Wolbrink's Unicode controls:
http://home.ccci.org/wolbrink/tntmpd/delphi_unicode_controls_project.htm

However, if you get "|", it means that the character was not converted,
but merely, you lack the proper font to display it. But you have to make
sure that you pass correctly the parameters to ExtTextOutW. 

I've been doing this kind of stuff for over two years. My apps (some
written in Delphi) allow display and input of Chinese, Japanese and
Korean characters in English Win9x/NT/2000/XP, in pretty much the same
way Office and IE5.0 do.

Francisco

Christian Sommerhuber wrote:
> 
> Hi Francisco,
> your answer seems promising. However as I can see in Excel, it's still
> Arial. So I used as well Arial. I switched between DEFAULT_CHARSET,
> ANSI_CHARSET, SHIFTJIS_CHARSET, THAI_CHARSET and CHINESEBIG5_CHARSET. When I
> paste the char here: "?" (at least when sending from my PC it shows up as
> Chinese character, although I didn't change the font).
> By the way I found as well an "Arial Unicode MS" and "Multinational Ext"
> font on my PC. They do as well the same as Arial.
> So what font do you think I have to use ?
> 
> Christian
> 
> "FL" <frleong@hotmail.com> wrote in message
> news:3C999693.B068D05@hotmail.com...
> > Christian Sommerhuber wrote:
> > >
> > > I've read the thread "Unicode? Help!" and followed the instructions.
> However
> > > when trying to output a widechar with
> > >
> > > #define UNICODE
> > >
> > > ....
> > >
> > >     wc[0]=21016;
> > >     wc[1]=0;
> > >     Form1->Canvas->TextOutW(30, 130, wc);
> > I don't think you can use TextOutW with VCL...
> >
> > >
> > > I always just get a question mark plotted. The next I tried was
> > >
> > >     HDC hdc = GetDC(0);
> > >     TextOutW(hdc, 30, 230, wc, 1);
> > >     RECT r={ 30, 300, 600, 400 };
> > >     ExtTextOutW (hdc, 30, 330, ETO_OPAQUE | ETO_GLYPH_INDEX , &r, wc, 1,
> 0);
> > >
> > > Both resulted in a bold "|".
> > You're using the wrong font. Select the right font and you'll get the
> > results you want.
> >
> > Francisco
Technical Details
Message-ID: <3C9C9D1F.3C9CD02F@hotmail.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!out.nntp.be!propagator-SanJose!in.nntp.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3c886b3f_1@dnews> <3C999693.B068D05@hotmail.com> <3c9b1d9d$1_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10297d,eee03ec3de08ad0a
X-Google-Attributes: gid10297d,public
X-Google-ArrivalTime: 2002-03-23 07:24:41 PST
Message-ID: <3C9C9D1F.3C9CD02F@hotmail.com>
Date: Sat, 23 Mar 2002 23:19:59 +0800
From: FL <frleong@hotmail.com>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internationalization
Subject: Re: UNICODE: Can't get it to the screen
References: <3c886b3f_1@dnews> <3C999693.B068D05@hotmail.com> <3c9b1d9d$1_2@dnews>
Content-Type: text/plain; charset=big5
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 202.175.98.186
X-Trace: dnews 1016896808 202.175.98.186 (23 Mar 2002 07:20:08 -0800)
Lines: 65
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!out.nntp.be!propagator-SanJose!in.nntp.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews