Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Sep 19, 2019 4:12 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Losing non-English characters when saving text to RTF
PostPosted: Thu Mar 03, 2011 11:34 am 
Offline

Joined: Wed Mar 25, 2009 4:30 pm
Posts: 245
Location: Alexandria, VA, USA
Hi Everyone,

I have a weird problem trying to save German text from a TextField into an RTF file like this:

tos = f.CreateTextFile
tos.write eula.Text
tos.close


The RTF is really just a text file. There is no rich text formatting. It works fine if everything is written in English, but when I get a EULA written in German it does weird things with the non-latin characters.

For example, the word "unveränderter" will become "unveränderter".

Any idea why this might be happening? I can copy and paste into an RTF file and there are no issues. I can't find any way to set the text encoding for output, only input.

Unfortunately I'm stuck with the RTF format because INNO Setup uses it.

Thanks!

-Mike


Top
 Profile  
Reply with quote  
 Post subject: Re: Losing non-English characters when saving text to RTF
PostPosted: Thu Mar 03, 2011 11:48 am 
Offline
User avatar

Joined: Sun Feb 19, 2006 3:10 pm
Posts: 1583
Location: Hamburg, Germany
rebrandsoftware wrote:
The RTF is really just a text file. There is no rich text formatting.

But there should be if it is supposed to be an RTF file. Do you use escape sequences for non-ASCII characters and does the encoding of the text correspond to the encoding declared in the RTF header?

_________________
Michael J. Hußmann
http://digicam-experts.de


Top
 Profile  
Reply with quote  
 Post subject: Re: Losing non-English characters when saving text to RTF
PostPosted: Thu Mar 03, 2011 4:49 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
TextArea.Text (I assume eula is a textarea) does not produce rtf, or any stylings, really. Have you tried

tos.write eula.StyledText.RTFData


Top
 Profile  
Reply with quote  
 Post subject: Re: Losing non-English characters when saving text to RTF
PostPosted: Thu Mar 03, 2011 5:37 pm 
Offline

Joined: Wed Mar 25, 2009 4:30 pm
Posts: 245
Location: Alexandria, VA, USA
No, I didn't even know it existed. I will give it a try right now.


Top
 Profile  
Reply with quote  
 Post subject: Re: Losing non-English characters when saving text to RTF
PostPosted: Thu Mar 03, 2011 5:43 pm 
Offline

Joined: Wed Mar 25, 2009 4:30 pm
Posts: 245
Location: Alexandria, VA, USA
Nice! I set Styled to true, saved the RTF data, and it worked.

Thanks, Tim!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group