I need to do a text replace action to set a version in a file. This has ben working fine in th epast, but the file has now been changed to be Unicode format. When I do the text replace now it corrupts the file. Is there a way to do a text replacement in a unicode file?
sigh I’m not 100% sure. The developer says he saved it from Notepad as “Unicode”. I just tried saving it from Notepad and it gives me the choices of: ANSI Unicode Unicode big endian UTF-8
So I’m not exactly sure what format notepad saves a file in when one specifies “Unicode”. Any clue how to tell what it really is?
I’m checking with the developer to figure out why we’re using this format.
My developer is clueless as to what format it’s in. he just knows that Visual Studio wants it this way. sigh Ever want to go apply a cluestick to someone’s head?
I’m guessing that since it differentiates “Unicode” from “UTF-8”, and gives and option for “big endian”, that it means UTF-16 when it says Unicode. Microsoft’s web page about the formats in Notepad (http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/win_notepad_utf_description.mspx?mfr=true) doesn’t help much, either. I guess they were afraid that having UTF-8 on the page is scary enough and they don’t dare put another scary acronym like UTF-16 on the same page, even though it would be really nice to know if that’s really the standard they’re using.
Ok, the Wikipedia page (http://en.wikipedia.org/wiki/Notepad) for Notepad says it does UTF-16 and UTF-8 and mentions it does both Endians of UTF-16, so this is pretty sure to be UTF-16.
Finalbuilder is not really unicode aware at this time.. I'm pretty sure the text replace action just treats the file as ascii. Unicode support is one of the focuses for the next major version of FinalBuilder.
You will probably need to resort to script (using the Run Script) action.
I ran into this Unicode limitation trying to write an Automise 3.0 script to analyze NTBackup log files, which are written in Unicode. I was able to work around it by adapting a VBScript from MSDN and creating a temp file for the analysis.
Before running the VBScript below, set the following variables:
LogFilePathAndName_Original - the original file (in Unicode) LogFilePathAndName - the temp file (used in the remainder of the Automise script)
Mark
' Adapted from "Copy a Unicode File to an ANSI File" under ' Windows Installer Scripting Examples. ' http://msdn.microsoft.com/en-us/library/aa368046(VS.85).aspx