Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Nov 20, 2019 1:29 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Encoding problem (string in CZ language shows ?)
PostPosted: Fri Feb 03, 2012 12:21 pm 
Offline

Joined: Wed Sep 10, 2008 6:48 am
Posts: 108
Location: The Netherlands (LB)
Hy,

I am trying to read and display a CSV textfile that is created by an other program.
The file contains some words from the Czech Republic language
In MS Windows Notepad the file is showed perfect including the special characters.

In my RS project the Czech characters are displayed wrong.
I tried several things with encoding, defineEncoding and convertEncoding
But no good results.

Does anybody know how to solve this?

_________________
Marc
The Netherlands
___________________________________________________________________
Desktop / Web: RealStudio with MySQL, Ben's Listbox, MBS plugins, DynaPDF
Mobile: Basic4Android Use this code (cgtdsr) if you want to buy an enterprice license -50%


Top
 Profile  
Reply with quote  
 Post subject: Re: Encoding problem (string in CZ language shows ?)
PostPosted: Fri Feb 03, 2012 12:32 pm 
Offline

Joined: Thu May 03, 2007 2:33 pm
Posts: 289
Sounds like it is encoding related. As far as I know, RS assumes UTF8 unless otherwise informed.

If you know what encoding the text file is, the following should work:

dim s as string = my_textinputstream.readall
s=DefineEncoding(s,Encodings.whatever)


If you don't know the encoding, the only thing I can think of is try a few more encodings until you get the right one.

Perhaps load the file into a string, break into the debugger, select the string in the debugger and use the debuggers facility to render the string in any encoding to cycle through them until you find the correct one.

Edit: Because Notepad loads it OK, it must know the encoding - what encoding is notepad set to for loading? Is it ANSI? in that case try:

dim s as string = my_textinputstream.readall
s=DefineEncoding(s,Encodings.WindowsANSI)


Top
 Profile  
Reply with quote  
 Post subject: Re: Encoding problem (string in CZ language shows ?)
PostPosted: Fri Feb 03, 2012 12:59 pm 
Offline

Joined: Wed Sep 10, 2008 6:48 am
Posts: 108
Location: The Netherlands (LB)
Hi,

If I don't set the encoding, just read it, then it return Code 1536 / "US-ASCII"

dim enc as textencoding
enc = data.Encoding
'breakpoint here view what enc is set to

_________________
Marc
The Netherlands
___________________________________________________________________
Desktop / Web: RealStudio with MySQL, Ben's Listbox, MBS plugins, DynaPDF
Mobile: Basic4Android Use this code (cgtdsr) if you want to buy an enterprice license -50%


Top
 Profile  
Reply with quote  
 Post subject: Re: Encoding problem (string in CZ language shows ?)
PostPosted: Fri Feb 03, 2012 1:17 pm 
Offline

Joined: Wed Sep 10, 2008 6:48 am
Posts: 108
Location: The Netherlands (LB)
encoding.windowsLatin1 is almost perfect.

Example:
Řetězová pila benzínová (It means something like: Chainsaw on fuel)
But the down-oriënted ^ on R and e are lost.

(I hope the browser shows this characters good :) )

_________________
Marc
The Netherlands
___________________________________________________________________
Desktop / Web: RealStudio with MySQL, Ben's Listbox, MBS plugins, DynaPDF
Mobile: Basic4Android Use this code (cgtdsr) if you want to buy an enterprice license -50%


Top
 Profile  
Reply with quote  
 Post subject: Re: Encoding problem (string in CZ language shows ?)
PostPosted: Fri Feb 03, 2012 3:19 pm 
Offline
User avatar

Joined: Sun Feb 19, 2006 3:10 pm
Posts: 1583
Location: Hamburg, Germany
ISOLatin2 would be the obvious choice for a Czech text.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Encoding problem (string in CZ language shows ?)
PostPosted: Sat Feb 04, 2012 8:09 am 
Offline

Joined: Thu May 08, 2008 2:26 am
Posts: 82
Marc wrote:
encoding.windowsLatin1 is almost perfect.

Example:
Řetězová pila benzínová (It means something like: Chainsaw on fuel)
But the down-oriënted ^ on R and e are lost.

(I hope the browser shows this characters good :) )



Řetězová pila benzínová = gasoline Chain Saw
Czech is my native language :wink:

... and ISOLatin2 is right

cu Paul

_________________
Graphic-BevelButton Class: MDButton
RealStudio (2008R1) & 2011R4 PRO (Win/Mac)
Windows 7 x64 Ultimate / Mac OSX 10.8


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 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