Erstellen einer UTF-8 oder UTF-16 Textdatei aus NAV

Wenn Sie normalerweise Dateien aus NAV erstellen, dann sind diese immer in ANSI kodiert.

Ich hatte mich einmal auf die Suche gemacht ob wir mit Hilfe von Automation Server eine UTF-8 oder UTF-16 Datei erstellen können.

Eine Möglichkeit ohne auf die .NET Interoperability von NAV 2009 R2 zurückzugreifen wäre es die Bibliothek 'Microsoft ActiveX Data Objects 2.8 Library' zu verwenden.

Name DataType Subtype Length
UTFStream Automation 'Microsoft ActiveX Data Objects 2.8 Library'.Stream

CREATE(UTFStream);
UTFStream.Open;
UTFStream.Charset('UTF-8');
//UTFStream.Charset('UTF-16');

UTFStream.WriteText('Ich bin UTF-8');
//UTFStream.WriteText('Ich bin UTF-16');

UTFStream.SaveToFile('c:TEMPUTFtext.txt');

UTFStream.Close;

 

Disclaimer
“Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. This mail message assumes that you are familiar with the programming language that is being demonstrated and the tools that are used to create and debug procedures.”

 

These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.

Mit freundlichen Grüßen

Sebastian Röttel

Microsoft Dynamics Germany

Microsoft Customer Service and Support (CSS) EMEA