Encoding problem with special chars

Mar 5, 2010 at 2:28 PM

How to encode spacial characters to transfer data ascii(csv) files or xml ÄÅÖ etc.

Any Help

 

Regards,

Markku

 

 

 

Mar 5, 2010 at 2:53 PM

Hi Marku,

The way I overcame this with French accents was to simply make sure the csv file was in UTF-8 format.

I'm not sure if this will work with your specific characters?...have you tried this?

Also make sure your xml mapping is using CDATA.

Regards,

Dave.

Mar 5, 2010 at 3:11 PM

How to change decoding for translation.  how to attach <vml version '1.0' encoding='windows-1252' to xml file.

what should be translation for &#214 versus Ä and &#196 Ö. Recommendation needed for utf-8 to windows-1252.

There is no possibility to change characters it in orinal csv file because it is outputtng automatically from the main system!

Regards,

Markku

PS. Example needed.

 

Mar 6, 2010 at 7:17 AM

Hi Markku,

Unfortunatly NB_Store assumes UTP-8 on the import (Maybe that's something we should change in the next version!).  From what you say I guess that your csv file is created automatically?...Do you do the input manually, if so then you can simply open the csv in notepad and save again in UTP-8 format.

If your doing something bit more fancy like automatically loading the csv into NB_Store then you going to have to either change NB_Store code to make sure when the xml data is created from the csv it has the header "<vml version '1.0' encoding='windows-1252'/>" (In either import.vb or importcsv.vb), although I can't be sure even this will work for you.  An alternative is to have the csv file automatically convert to utf-8 by code either in NB_Store or a separate program...you'll need something like this I think..

'Convert string between windows-1250 and utf-8 charsets
Dim ByteArray
Set ByteArray = CreateObject("ScriptUtils.ByteArray")

'Read file with source code page.
ByteArray.ReadFrom "some-windows-1250-file.txt"

'Set right code page for the bytearray
ByteArray.CharSet = "windows-1250"

'Convert the data to a destination code page and save them to a second file
ByteArray.CharSetConvert("utf-8").SaveAs "utf-8-output.txt"

Obviously I've not tested this, but it gives you some options.

Regards,
Dave.