Char2UTF8() in XML

This forum is for eXpress++ general support.
Post Reply
Message
Author
skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Char2UTF8() in XML

#1 Post by skiman »

Ho,

I'm using the Char2UTF8() to add data to an XML. I need this for French characters as é è à and so on.

Now this seems to be wrong interpreted by Microsoft Edge when you open the XML.

Anyone who is using french characters in an XML? Or special characters as are used in German, Spanish, Romanian, ... Which conversion are you using?

Thanks for any help.
Best regards,

Chris.
www.aboservice.be

User avatar
PedroAlex
Posts: 230
Joined: Tue Feb 09, 2010 3:06 am

Re: Char2UTF8() in XML

#2 Post by PedroAlex »

HI Chris,
It depends on what the purpose of the XML is.
I use Windows -1252 to generate the XML for the tax authority and it works well with Portuguese characters.
Pedro Alexandre

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Char2UTF8() in XML

#3 Post by skiman »

Hi Pedro,

Thanks for the suggestion but it seems as it isn't working.

I changed the encoding and I removed the char2utf8. Now I can open the XML with Edge without a problem, but the signs as é à è aren't correctly shown.

I'm using Chilkat to create the XML. I don't know if that could be the cause of my problem.
Best regards,

Chris.
www.aboservice.be

User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: Char2UTF8() in XML

#4 Post by digitsoft »

You could send an example of the XML file
Nolberto Paulino
Regards

k-insis
Posts: 100
Joined: Fri Jan 28, 2011 4:07 am

Re: Char2UTF8() in XML

#5 Post by k-insis »

Make sure you are compiling exe into ANSI mode, not OEM.

As I am rather inclined into doubt of utf capability of xpp own functions, can you use ot4xb conversion function to do conversion?

But yes, provide xml in zipped format , please so we can see inside.
skiman wrote: Fri Jan 12, 2024 3:27 am Ho,

I'm using the Char2UTF8() to add data to an XML. I need this for French characters as é è à and so on.

Now this seems to be wrong interpreted by Microsoft Edge when you open the XML.

Anyone who is using french characters in an XML? Or special characters as are used in German, Spanish, Romanian, ... Which conversion are you using?

Thanks for any help.

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Char2UTF8() in XML

#6 Post by skiman »

Hi,

In attachment a sample.

In de tag <deliveryaddress><street> I placed the following in my Xbase app:
street é à test
.

In my source code I have:

Code: Select all

...
oXml:newchild2("orderHeader|deliveryAddress|street",ConvCpToUtf(alltrim(cAdres)))
...
The function ConvCpToUtf is as follows:

Code: Select all

function ConvCpToUtf(cText)
***************************
if !empty(cText)
	return cOemToUtf8(cText)
endif
return ""
The result is the same when using the Xbase conversion function of the OT4XB function.

In attachment the XML file.
Attachments
sample.zip
(646 Bytes) Downloaded 88 times
Best regards,

Chris.
www.aboservice.be

Post Reply