How to change encoding from ISO to UTF on customerbs document

Hi,

I’ve read many thread on this but none seems to be complete…

We receive an xml document from one of our customer with
<?xml version=“1.0” encoding=“iso-8859-1”?>
as the encoding.
We want to replace it with
<?xml version=“1.0” encoding=“UTF-8”?>
because it’s messing up some french characters. They can’t change it so we must do something on our end.

I know I may have to build a new receive service (instead of the default wm.tn:receive one) but I’m not sure of the steps I should use. Should I do a recognize first an then transform the string or bytes to utf-8 ? Or maybe I should use some recordtodocument/documenttorecord ? I’m not sure…

Can anyone help ?

Thanks !
Mat

The service pub.xml:loadXMLNode (set encoding=utf-8) might help the problem.Invoke this in your custom receive service and Once you have Node in the pipe use the xmlNodeToDocument (for parsing)

This is a straight forward approach that replaces the encoding.Sorry if this is not you are looking for.

HTH,

Yeah, that make sense but i forgot to say that we’re using 4.6 and not 6.0 so these services does not exist.

I found a way to do it with converting the $xmldata string before calling the recognize (inside the wm.tn:receive service):

stringToBytes (set encoding to UTF-8)
bytesToString
stringToDocument
and then call wm.tn:receive

It does the job!

Thanks anyway for your quick response.

I’m experiencing this problem with an EDI X12 file. The encoding in the EDI config file is set to UTF-8. The file is dropped off in a file poller directory where the file poller service ftp’s the file wn.tn.receive. On the ftp command I’m setting the encoding to UTF-8 but the file still gets truncated at the french e.

Any suggestions how to fix this?

What encoding is the operating system?

Ray,

I’m on WIN2K system. The default encoding for wm is UTF-8.
I’m not sure if that’s what you were asking.

chris