Article View: borland.public.cppbuilder.internationalization
Article #103Re: Unicode newbie
From: Andrue Cope [TeamB]
Date: Mon, 20 Dec 2004 09:09
Date: Mon, 20 Dec 2004 09:09
70 lines
3739 bytes
3739 bytes
nicolasr wrote: > 1) Are there any prerequisites I need to draw Unicode text > via the TextOutW API on WinXP and how about Win98? > (The Api docs state that TextOutW is supported on Win98) You need to have selected a Unicode font that supports the language you want. Although Unicode can support 65535 characters not all fonts implement the entire range. One font that support a wide range should by now be available on all Windows machines - Arial Unicode MS. > 2) I have installed several languages like Chinese, Thai, Arabic > etc.. Does this have anything to do with Unicode or is this > only necessary for using multi-byte character mode? Multi-byte only unless they also happen to install a Unicode font. > 3) Could AnsiString be used to store chinese text (in multi-byte > format)? How about Turkish which has only a few additional > characters to the ANSI set? AnsiString can be used to hold strings containing one of the small subset of Chinese characters that have 8-bit codes. Given the huge number of 'characters' in Chinese languages there is no way that all of them could ever be encoded in a single codepage. There is a way of encoding 16-bit codes using pairs of 8-bit characters but I don't think AnsiString/Win32 supports that. Turkish will be fine as long as you have the Turkish code page active. > 4) Can Chinese developers use BCB? I know that > VCL doesn't support Unicode and I know that there are component > collections that do support it. That I don't know. I think Chinese users get used to using a subset of their language or else resort to the Roman Alphabet. > But how would a chinese developer > assign a chinese text in code to a WideString property? No idea but they have different keyboards so probably it's done that way. We can use Character Map but surely they have something better. > Compared > to for example C#Builder the BCB editor does not seem to be able > to store Unicode text in source files. No it can't. They'd probably have to use hex codes in strings. > 5) My first test for this was to try to assign a single turkish > character and print it out with TextOutW, f.e.: > //user code > WideString w = (wchar_t)0x0130; > myComponent->CaptionUC = w; > > //in the component (pascal code) > TextOutW(C.Handle, X, Y, PWideChar(CaptionUC), Length(CaptionUC)); > > From my Unicode table this should result in a capital 'i' with a dot > above. But all I see is a black rectangle (unknown character???). myComponent->Font->Name="Arial Unicode MS"; As noted above - not all Unicode fonts support all the characters they could. -- Andrue Cope [TeamB] [Bicester, Uk] http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<41c696ef$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.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-mailReferences:
<41c38073$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10297d,888aa050d7462947 X-Google-Attributes: gid10297d,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Andrue Cope [TeamB]" <no.spam@not.a.valid.address> Subject: Re: Unicode newbie Newsgroups: borland.public.cppbuilder.internationalization References: <41c38073$1@newsgroups.borland.com> Date: Mon, 20 Dec 2004 09:09:44 +0000 User-Agent: XanaNews/1.16.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 NNTP-Posting-Host: 217.207.223.34 Message-ID: <41c696ef$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103533807 217.207.223.34 (20 Dec 2004 01:10:07 -0800) Lines: 70 X-Authenticated-User: acope Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.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