1

I am importing from an Excel/OpenOffice generated CSV file into Navision (Classic Client NAV2009) with this code.

MyFile.Textmode(TRUE);
MyFile.OPEN('c:\temp\test.csv');
MyFile.READ(MyLine); (Text field);
MyFile.CLOSE;
CLEAR(MyRec);
MyRec.Text1 := MyLine;
MyRec.Insert;
COMMIT;

test.cvs is an export from text.xls and has this single line:

ABC äöüßÄÜÖ éèÑñ

What encoding should I use when saving this file from xls to csv so the special characters arrive in the Navision record unharmed?

4

1 回答 1

1

NAV 正确地期望 ASCII 输入。所以你需要做的就是将它从 ANSI 转换为 ASCII。应用于您上面的代码将是: MyRec.Text1 := AsciiFunction.Ansi2Ascii(MyLine);

大多数 NAV 开发人员在他们的“工具箱”中都有这个功能,但如果你没有,那么你可以在这里找到它:http: //dynamicsuser.net/files/storage/extra/nav/ascii_function.txt

于 2013-10-03T15:35:02.490 回答