Condividi tramite


TextEncoding Property

Specifies the text encoding format to use when using an XMLport to export or import data as text.

Applies to

XMLports

Note

The TextEncoding property is only available when the Format Property (XMLports) of the XMLport is set to Fixed Text or Variable Text.

Values

  • MS-DOS (default)

  • UTF-8

  • UTF-16

Remarks

Text encoding is the process of transforming bytes of data into readable characters for users of a system or program. When importing a file as text with an XMLport, the text encoding format ensures that all the language-specific characters are represented correctly in Microsoft Dynamics NAV. When exporting a file as text, the text encoding format ensures that all the language-specific characters are represented correctly in the system or program that will read the exported file. There are several industry text encoding formats and different systems support different formats. Internally, Microsoft Dynamics NAV uses Unicode encoding. For exporting and importing data with an XMLport, Microsoft Dynamics NAV supports MS-DOS, UTF-8, and UTF-16 encoding formats. Data is imported and exported as follows:

  • When data is imported from an external file, it is read using the format that is specified by the TextEncoding property, and then converted to Unicode in Microsoft Dynamics NAV.

  • When data is exported to an external file, it is converted from Unicode in Microsoft Dynamics NAV, and then written to the file in the format that is specified by the TextEncoding property.

You should set the TextEncoding property to the encoding format that is compatible with the system or program that you will be exporting to or importing from. The following sections describe the available text encoding formats.

MS-DOS Encoding Format

MS-DOS encoding, which is also referred to as OEM encoding, is an older format than UTF-8 and UTF-16, but it is still widely supported. MS-DOS encoding was the only format that was supported by earlier versions of Microsoft Dynamics NAV.

MS-DOS encoding requires a different character set for each language. When the property is set to MS-DOS, text is encoded by using the system locale language of the computer running Microsoft Dynamics NAV Server. So if you use MS-DOS encoding, you should set the system locale language of Microsoft Dynamics NAV Server to match the language of the data being transferred by the XMLport. For example, if the XMLport includes text in Danish, then you should set the system locale language of Microsoft Dynamics NAV Server to Danish before you export or import the XMLport.

You should choose MS-DOS with XMLPorts that were created in earlier versions of Microsoft Dynamics NAV.

UTF-8 Encoding Format

UTF-8 encoding is a Unicode Transformation Format that uses one byte (8 bits) to encode each character. UTF-8 is based on the Unicode character set, which includes almost all characters of all languages in a single character set.

Unlike MS-DOS, when you use UTF-8, you do not need to consider the language settings of Microsoft Dynamics NAV Server or the external system or program that will read or write the text file.

UTF-8 is compatible with ASCII so it will understand files written in ASCII format.

UTF-8 is the most common encoding format and the recommended setting if you are unsure of the format that is supported by the system that you are integrating with.

UTF-16 Encoding Format

UTF-16 encoding is similar to UTF-8 except that UTF-16 uses 2 bytes (16 bits) to encode each character. UTF-16 is also based on the Unicode character set, so you do not need to consider the language setting of Microsoft Dynamics NAV Server or the external system or program that reads or writes the text file.

UTF-16 comprises two encoding schemes which mandate the byte order: UTF-16LE and UTF-16BE. Microsoft Dynamics NAV supports these schemes according to the following:

  • When exporting, the file is written using UTF-16LE encoding.

  • When importing, the file is read using the UTF-16, UTF-16LE, or UTF-16BE, depending on encoding scheme of the file itself.

A UTF-16 encoded file will typically be larger than the same file encoded with UTF-8, except for Eastern language character sets, which will typically be smaller.

UTF-16 is not compatible with ASCII so it will not understand files written in ASCII format.

See Also

Tasks

How to: Design XMLports
Walkthrough: Importing Data from Text Files to Tables

Reference

Format Property (XMLports)

Concepts

XMLports