Article View: borland.public.cppbuilder.internationalization
Article #102Unicode newbie
From: nicolasr
Date: Sat, 18 Dec 2004 00:57
Date: Sat, 18 Dec 2004 00:57
64 lines
3271 bytes
3271 bytes
Hi, this is the first time I'm trying to work with Unicode and I have some probably very basic questions. I have read about fonts and languages in the API but I'm still quite confused about it. What I'm trying to do: I want to write a component that has some string properties that are currently AnsiStrings. Since BCBs object inspector doesn't seem to support WideString I thought about adding public WideString properties such that the user can at least assign Unicode text in code. F.e. public: __property WideString CaptionUC... __published: __property AnsiString Caption... When CaptionUC would be assigned then Caption would be ignored... I'm currently developing and testing on a german WinXP. Assume the user wants to use chinese characters for the caption, f.e. Questions: 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) 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? 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? 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. But how would a chinese developer assign a chinese text in code to a WideString property? Compared to for example C#Builder the BCB editor does not seem to be able to store Unicode text in source files. 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???). I would be grateful for any comments that help me get a little more insight into the topic. Links and articles also welcome. thanks, Nick
Technical Details
Message-ID:
<41c38073$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.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-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10297d,888aa050d7462947,start X-Google-Attributes: gid10297d,public X-Google-Language: ENGLISH,ASCII-7-bit From: "nicolasr" <nicolasrNOSPAMATSIGNgmx.net> Newsgroups: borland.public.cppbuilder.internationalization Subject: Unicode newbie Date: Sat, 18 Dec 2004 01:57:20 +0100 Lines: 67 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 80.133.165.117 Message-ID: <41c38073$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103331443 80.133.165.117 (17 Dec 2004 16:57:23 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.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