September 1, 20232 yr I would like to export a text field, but the characters in the exported file occupy 2 bytes. I would only need the 1-byte character codes. How can I create such an export? I show the problem in this picture.
September 1, 20232 yr Are you using the Export Field Contents instruction? If so, the resulting file uses UTF-16 encoding. There are several methods to produce a UTF-8 encoded file; which one would be most suitable for you depends on what exactly you are doing. For example, you could isolate the record and export it as tab-separated, with only one field in the field export order. But that wouldn't work well if the field contains tabs or carriage returns.
September 1, 20232 yr Author 7 minutes ago, comment said: Are you using the Export Field Contents instruction? If so, the resulting file uses UTF-16 encoding. There are several methods to produce a UTF-8 encoded file; which one would be most suitable for you depends on what exactly you are doing. For example, you could isolate the record and export it as tab-separated, with only one field in the field export order. But that wouldn't work well if the field contains tabs or carriage returns. Yes, I want to export a calculated character chain in a text field, but i need this exactly. The character chain does not contain control or special codes, just letter, numbers and "space" characters.
September 1, 20232 yr Well, you already have one possible method. Briefly, other options are: Use the TextEncode() function to create the file in a global container field; then export the container field's contents (requires v. 16 or higher); Same thing as above, only using the Base64Encode and Base64Decode functions (this works in v.13 and up); Write directly to a data file (requires v.18+); Export the record as XML using a custom XSLT stylesheet; this allows you to choose the target file's encoding and preserve all special characters (works in all versions since v.6)
September 1, 20232 yr Author 36 minutes ago, comment said: ..... Write directly to a data file (requires v.18+); Thanks for the help, writing directly to the file and utf-8 setting solved my problem.
Create an account or sign in to comment