XML File Generation. UTF8 vs ISO 8859. What decides this

johndanter

johndanter

Legendary Poster
Hello list,

Bit of a techy one this.
I have a client who send VAT files off to the Belgian government using UBE R74B150.
Thing is the Bel Gov changed the allowed format from UTF8 to ISO 8859 some time ago (grace period is now over and all files must be encoded with ISO 8859)

I've watched where the XML file is created and narrowed it down to....
Init Section: line 259 on the Business View over F0018 F0101 uses BSFN XML Load APIs 74B and then XML Create Document with Attributes 74B but nowhere in this code do I see where to setup the encoding
My current XML starts with this:

<?xml version="1.0" encoding="utf-8" ?>
they want....
<?xml version="1.0" encoding="ISO-8859-1" ?>


My belief is API XRCS_initEngine is responsible for this in the XercesWrapper but I can't see how to switch the formats over

Anyone?

I'm on 8.11 SP1

Thanks

John
 
John,

look at app P93081 - Flat File Encoding. Setup a entry for your application that uses CP1252 - which is the same as 8859-1. Let us know if this works.

Cheers,
 
Cheers Larry.
It's my day off today but I've asked them to have a look

Ta

John
 
John,

I wonder if the issue is with the XRCS API to create the XML document (serialize). It looks like that UBE calls the UTF-8 version. There is a XRCS_serializeDocumentToFileWithEncoding API, but according to the documentation it only supports UTF-8 and UTF-16.

Perhaps you can convert the file after it's created by the UBE?

Craig
 
Cheers Craig.
I've been looking all over the code, BSFNs and APIs called and I can't see anywhere any mention of choosing or being able to chose encoding used.

I'm thinking this is one for CNC but they don't know where to start tbh
frown.gif

I'm helping all I can but there must be a setup somewhere for this
 
Here's what the API declaration states
<font class="small">Code:</font><hr /><pre>
/***********************************************************************
FUNCTION: XRCS_serializeDocumentToFileWithEncoding
DESCRIPTION:Write a document to file
PARAMETERS:
hDoc
Handle to the document to write to the file
szFileName
Name of the file to write the document to
szEncoding
Name of the encodng to write the document (only UTF-8 and UTF-16 allowed)
***********************************************************************/

EXTERNC JDERTN(XRCS_Status) JDEWINAPI XRCS_serializeDocumentToFileWithEncoding(const XRCS_hDocument hDoc,
const JCHAR* szFileName,
const JCHAR* szEncoding
);
</pre><hr />

In that UBE it's calling a wrapper NER which eventually calls another BSFN that passes the literal string "UTF-8" to the above function. According to the description though, UTF-16 is the only other choice.

I don't see a way inside of JDE (within the XRCS APIs) to get it converted to ISO-8559. Sorry to say.
 
Cheers matey. After my sniffing around thats the conclusion I came too.
I could hard code 8859 but I doubt it would be so simple.
Life never is
smile.gif


I'm thinking tools release update of some sort to do this....?
 
I've taken ESU JJ17938 and JJ17983 for this and still no joy

File is still encoded in UTF8...


Any ideas anyone?

Anyone else send VAT to the Belgium Government?

John
smile.gif
 
I am curious as to what the underlying lib is for the Oracle Xerces wrapper calls. The appache.org lib? If so, I think it does support ISO-8859-1 (link). You might try and pass "ISO-8859-1" to XRCS_serializeDocumentToFileWithEncoding and see what happens, maybe the wrapper function simply passes this param through to the underlying lib call.

Otherwise, I guess I would be looking to do some post processing or create a wrapper to XRCS_serializeDocumentToFileWithEncoding that first encodes to UTF16 then converts to 8859-1 somehow.
 
BOBster, that's awesome mate, as this morning I was going to try just this, but didn't know enough about it.
This document is very very useful.

Line 5059 of B74XML01 is this:
xmlcStatus = XRCS_serializeDocumentToFileWithEncoding(hDoc, dsDSI74XML01FILE.szXMLFullFileName,_J("UTF-8"));

So I was indeed going to try my luck at hard coding the value I want.

Wish me luck
smile.gif


Thanks again
 
Bummer!
I've changed the hardcoded value to ISO-8859-1, no file

I've changed the hardcoded value to UTF-16, I get a file

I've changed the hardcoded value to CP1252, no file

So it looks like UTF8 and UTF16 are currently the only allowed version of encoding open to us in 8.11
 
Or does anyone know of a good reliable XML convertor tat can convert said formats?

Thanks

John
 
Try iconv, it is available on most platforms. If you're Linux, it is already installed. Some of the other UNIX vendors also ship it installed.

Can convert with commands like:
iconv -f 'utf-8' -t 'iso-8859-1' utf-8.xml > iso8859-1.xml
 
i'm wondering if you're successful on this. Can you please share the outcome as i'm workin on similar things
 
I have just started investigating this and have found the Intervat schemas for Belgian XML file VAT submission (uses the official XSD scheme published by the Belgian Tax Authority) via the following URL (there is no english translation site available):

http://minfin.fgov.be/portail2/fr/e-services/intervat/calendrier.html

Example of first few lines of Periodic Declaration scheme:

<?xml version="1.0" encoding="ISO-8859-1" ?>

- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

xmlns="http://www.minfin.fgov.be/VATConsignment"

xmlns:common="http://www.minfin.fgov.be/InputCommon"

targetNamespace="http://www.minfin.fgov.be/VATConsignment"

elementFormDefault="qualified"

attributeFormDefault="unqualified" version="1.0"

xml:lang="en">


<xs:import

namespace="http://www.minfin.fgov.be/InputCommon"

schemaLocation="IntervatInputCommon_v0_7.xsd" />

.
.
.




Anyone know how close the JDE XML output via R74B150 is to this scheme? (Cannot generate XML at the moment as I am missing a number of XML related business functions)

Still at the very early stages of my investigation so any input from anyone successfully doing this from ERP8 appreciated.
 
Back
Top