ADS error 7200: There is an error converting Unicode string to or from code page

This forum is meant for questions and discussions about the X# language and tools
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

ADS error 7200: There is an error converting Unicode string to or from code page

Post by wriedmann »

Hi Chris,
since my fix does not seems to have fixed the issue, I have now created a new XIDE project, and switched to the UTF8 charset for the source code files, but I have not be able to paste or input these charactes using the XIDE source editor.
Opening the file in UltraEdit let me set these characters, and writing them to a file showed me that my fix effectively don't works.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4910
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

ADS error 7200: There is an error converting Unicode string to or from code page

Post by Chris »

Hi Wolfgang,

What happens when you type or paste those characters? Nothing gets inserted? Or maybe some other characters get inserted? Which are those characters?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

ADS error 7200: There is an error converting Unicode string to or from code page

Post by wriedmann »

Hi Chris,
for my tests I have used mostly characters you should know - the greek uppercase signa.
I cannot type that, and when pasting from the clipboard, I get only "?" characters.
But when I change the prg file with UltraEdit, it will show up correctly.
Wolfgang
P.S. strange enough: the System.Console.WriteLine() seems to to exactly what I need: it changes the characters to the neareast approximation.
This is the original:
original.png
original.png (2.63 KiB) Viewed 587 times
and this how the console shows it:
console.png
console.png (2.43 KiB) Viewed 587 times
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4910
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

ADS error 7200: There is an error converting Unicode string to or from code page

Post by Chris »

Hi Wolfgang,

Can you please post the characters here as text, so I can try to copy & paste them?

Thanks!
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

ADS error 7200: There is an error converting Unicode string to or from code page

Post by wriedmann »

Hi Chris,
here they are:
"Lerch Genusswelten „Mehr Erfahren“ Button funktioniert nicht"
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

ADS error 7200: There is an error converting Unicode string to or from code page

Post by wriedmann »

Hi Chris, hi all,
it seems now I was able to solve that issue:

Code: Select all

static method FixAnsi( cString as string ) as string
local cReturn as string
local oUnicode as System.Text.Encoding
local oAnsi850 as System.Text.Encoding

oUnicode := System.Text.Encoding.Unicode
oAnsi850 := System.Text.Encoding.GetEncoding( 850 )	

cReturn := oAnsi850:GetString( System.Text.Encoding.Convert( oUnicode, oAnsi850, oUnicode:GetBytes( cString ) ) )

return cReturn
The important thing is to use codepage 850 for ADS.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4910
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

ADS error 7200: There is an error converting Unicode string to or from code page

Post by Chris »

Hi Wolfgang,
Chris wrote:Hi Wolfgang,

Can you please post the characters here as text, so I can try to copy & paste them?

Thanks!
OK, thanks, this is really bizzarre now, I copied/pasted it this into XIDE and it looks just fine :)
Even saving/loading etc. What font are you using for the editor?

About the codepage, it seems a little strange to me that this could solve the problem, but if it indeed solves it for you, that's perfect!
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

ADS error 7200: There is an error converting Unicode string to or from code page

Post by wriedmann »

Hi Chris,

that is strange.... I'm using the Hack font, and when modifying the characters from an external editor they show up...

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4910
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

ADS error 7200: There is an error converting Unicode string to or from code page

Post by Chris »

Hi Wolfgang,

What if you use a different font like Courier New, does it work properly this way? If yes, I will look into the hack font to se why it does not work. Or maybe you can send me the exact one that you are using, so I make sure I use the same?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

ADS error 7200: There is an error converting Unicode string to or from code page

Post by wriedmann »

Hi Chris,

with Courier New it is exactly the same.
This is the text how it is shown in UltraEdit:
ultraedit.png
ultraedit.png (2.22 KiB) Viewed 587 times
and this how it is pasted in XIDE
xide_pasted.png
xide_pasted.png (2.48 KiB) Viewed 587 times
and this how is shown in XIDE when opening the file changed externally
xide_opened.png
xide_opened.png (4.19 KiB) Viewed 587 times
Hack and Courier New show exactly the same behavior.
So I suspect it has to do with copy&paste.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply