Hello,
I receive various text files with various encoding. I have older systems which can only accept files with no code page or Windows-1252. I have had good success using UE to manually open CSV files and save them as ANSI/ASCII with DOS Terminators. Doing this, the few accented characters I sometimes encounter are rendered nicely (technically they're being converted to similar-looking characters within the more limited ASCII character set) and my other systems accept the files just fine.
I'd like to create a macro to do this, however, when recording a macro I click Save As and then set the Line Terminator and Format ... but only the SaveAs and file name is being recorded.
I noted the UnicodeToASCII macro command and tried it. If in fact the selected file is UTF-8, it works, but if it is already ASCII, the command destroys the file contents. This isn't quite the same as manually selecting the Line Terminator and Format while Saving within UE, as this doesn't destroy the file if it is already ASCII.
Because I don't know the file format in advance, and see no command to detect it programmatically, I'm at a loss. How can I either programmatically detect if conversion is needed, or, perform the Save As including the Line Terminator and Format parameters the same as when done manually (and therefore not destroy the file if it is already ASCII)?
Thanks in Advance
I receive various text files with various encoding. I have older systems which can only accept files with no code page or Windows-1252. I have had good success using UE to manually open CSV files and save them as ANSI/ASCII with DOS Terminators. Doing this, the few accented characters I sometimes encounter are rendered nicely (technically they're being converted to similar-looking characters within the more limited ASCII character set) and my other systems accept the files just fine.
I'd like to create a macro to do this, however, when recording a macro I click Save As and then set the Line Terminator and Format ... but only the SaveAs and file name is being recorded.
I noted the UnicodeToASCII macro command and tried it. If in fact the selected file is UTF-8, it works, but if it is already ASCII, the command destroys the file contents. This isn't quite the same as manually selecting the Line Terminator and Format while Saving within UE, as this doesn't destroy the file if it is already ASCII.
Because I don't know the file format in advance, and see no command to detect it programmatically, I'm at a loss. How can I either programmatically detect if conversion is needed, or, perform the Save As including the Line Terminator and Format parameters the same as when done manually (and therefore not destroy the file if it is already ASCII)?
Thanks in Advance