🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Polish from edit to file

#70
From: Roland Seidel
Date: Fri, 09 Sep 2005 09:26
30 lines
2124 bytes
I need to handle Polish text and I'm working with a small test app to 
get started.
I want to have a TEdit into which I can type Polish, collect the text, 
save it in a file, retreive it from file and draw it on a TCanvas.
I'm using BCB6 on Windows XP, I've installed Polish language support so 
I can type letters with diacriticals in Word using Alt-a etc. and I'm 
assuming I can do the same with a TEdit.
I am compiling with _UNICODE defined but I'm not sure if it is necessary.

I can't get a TEdit to work but I can type Polish into a TRichEdit.
Is it possible to type Polish into a TEdit?

I'd like to use TFileStream if I can but
  TFileStream* fs = new TFileStream(filename, fmCreate|fmShareExclusive);
  AnsiString S = RichEdit->Text;
  int n = S.Length();
  fs->Write(S.c_str(),n);
  delete fs;
lost all the diacriticals and
  WideString WS =  RichEdit->Lines->Strings[0]; //RichEdit->Text;
  int n = WS.Length();
  fs->Write(WS.c_bstr(),n);
saved as wide chars but the second byte was always zero - still no 
diacriticals.

How can I get text out of an edit and into a file?

thanks

Roland
Technical Details
Message-ID: <4321551b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10297d,2d3e00c5efcd9463,start
X-Google-Attributes: gid10297d,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 09 Sep 2005 19:26:55 +1000
From: Roland Seidel <roland@redcentresoftware.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internationalization
Subject: Polish from edit to file
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 202.164.198.171
Message-ID: <4321551b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1126257947 202.164.198.171 (9 Sep 2005 02:25:47 -0700)
Lines: 31
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!194.25.134.62.MISMATCH!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail