Converting Unicode to ASCII through C/SIDE

Hi everyone, Maybe this is a non-sense question… I am reading some data from an external Data Source which uses Unicode. Obviously, when this data gets written into the Navision database, the text is wrong. Is there anyway to convert the Unicode text into ASCII text? Using a custom C/SIDE function or an external component? Thanks a lot, Nelson

your NSC, NTR shoudl be able to provide you the conversion codeunit.

I don’t suppose someone would have this codeunit around, would they??? [8D] You see, I am a Navi-developer inside a company and, as such, we don’t have a maintenance/support agreement with a Solution Center (MBS Partner?) If anyone has any ideas, please post them!

Oi, Is it perhaps coming from Oracle? Since it’s internal, within company, wouldn’t it eliminate a step to try and export in ASCII? Tchau

Already tried to download Ultraedit? Very usefull for text editing and conversion

Take a look in the download form. There is an ANSI to ASCII tool there. This might help you out. I have not ever looked at this, but I know it it there.

You won’t necessarily be able to convert Unicode <-> ANSI accurately because Unicode is a 65K character set and ANSI is a 256. This was the intention of Unicode. But, many ANSI code pages to not suffer conversion problems when you do so, so it is dependent on your code page. Windows offers the C functions WideCharToMultiByte() and MultiByteToWideChar() for doing this (also to/from OEM code pages), so if you can wrap these in an OCX you can do it from within Navision or else do it before the data arrives in Navision.

Hi, thanks for the answers. I was finally able to solve the problem. Changing the ODBC driver to a different one gave me an option to use ASCII, so the conversion is no longer needed. robertc, I had already thought of this Windows function and asked our VB programmer if he could just throw it into an OCX for me. I think it would be the best - maybe not the only - solution for converting text strings inside the C/AL code. Thanks again