xsharp.eu • ADS error 7200: There is an error converting Unicode string to or from code page - Page 2
Page 2 of 3

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

Posted: Fri Jun 05, 2020 2:00 pm
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

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

Posted: Fri Jun 05, 2020 2:22 pm
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?

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

Posted: Fri Jun 05, 2020 2:38 pm
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 545 times
and this how the console shows it:
console.png
console.png (2.43 KiB) Viewed 545 times

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

Posted: Fri Jun 05, 2020 2:41 pm
by Chris
Hi Wolfgang,

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

Thanks!

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

Posted: Fri Jun 05, 2020 2:45 pm
by wriedmann
Hi Chris,
here they are:
"Lerch Genusswelten „Mehr Erfahren“ Button funktioniert nicht"
Wolfgang

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

Posted: Fri Jun 05, 2020 3:45 pm
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

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

Posted: Fri Jun 05, 2020 5:32 pm
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!

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

Posted: Fri Jun 05, 2020 5:38 pm
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

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

Posted: Fri Jun 05, 2020 5:42 pm
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?

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

Posted: Sat Jun 06, 2020 6:25 am
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 545 times
and this how it is pasted in XIDE
xide_pasted.png
xide_pasted.png (2.48 KiB) Viewed 545 times
and this how is shown in XIDE when opening the file changed externally
xide_opened.png
xide_opened.png (4.19 KiB) Viewed 545 times
Hack and Courier New show exactly the same behavior.
So I suspect it has to do with copy&paste.

Wolfgang