We have worked around a problem with IA writing BOMs to text files, (and worked around a problem with writing to binary files not creating files like writing to text files does), with the following pseudo-code:
Code: Select all
Set Variable FILE_DATA to
Set Variable NEW_TEXT_VALUE to Lorum Ipsum
Read from Text File #READALL\config_file_in.txt into Variable FILE_DATA
Replace TEXT_TO_REPLACE with $NEW_TEXT_VALUE$ in variable FILE_DATA
Write into Text File config_file.txt from Value (at end of file)
Write $FILE_DATA$ to binary file config_file.txt at offset 0
This works well and good for your usual ASCII text. But we have been surprised by a problem with non-ascii text. When, for example, Japanese text is written, all we get is "?????" in the file.
Why is this this case? I would have thought writing to a binary file would have simply written the data "as is" to the file because it's binary data!?
Demo project attached.