Hello,
I'm importing data from a csv file that potentially contains french or spanish characters (éàñ ... etc).
To have the correct character string in Navision, I use the well known ansi2ascii fonction, that works just fine.
However, it seems that there is a problem when comparing a converted string with a string written in C/AL !
for eg :
var_description = 'hello world' (value of the import)
description := ansi2ascii(var_description);
if description = 'hello world" then ... etc
For Navision description and 'hello world' are not the same strings ....
NB : it works if I write this :
if description = ansi2ascii('hello world') then ... etc
Anyone got this problem ?
Do I really need to convert ALL the strings I need to compare in C/AL ?????
Thx for the help
0
Comments
Dynamics West
http://www.dynamicswest.com
Sometimes (Depending on the programs you use later, f.i. Excel) it converts a "space" to a lower value which in Excel is interpreted as an "à" character. Try your code again but now with "HelloWorld" (without the space).
I'm continuing my investigation
|To-Increase|
In the MakeVars function (CUnit ANSI <-> ASCII converter), I just removed the last char of the strings AsciiStr and AnsiStr.
The both were visually spaces but only the char in the AnsiStr was a "real" space.
I did not find which ascii char was used as "space" in the AsciiStr (in a unix file it's displayed as "| ").
I dont know if it's a bug in the CU.
Could you test the following:
> Open csv in Excel
> Saveas new csv
> Compare the two csv files or import in NAV
In the new csv file, I still have the "à" chars but maybe it is only with my Office version