I am trying to parse a log file generated from an external (windows) command my setup need to execute.
It does not work, read from text file does not handle unicode when reading:
Read from Text File #READALL\c:\Windows\security\logs\scesrv.log into Variable sec_log
I have seen some posts about bugs in unicode handling and one suggestion was to add an empty line at the start of the file, but if I try:
Write into Text File c:\temp\scesrv.log from Value RESULTS: (at start of file)
IA will delete the file contents if the file is unicode!
At the moment I am totally stuck in my project due to this.
I am on IA 17 build 8.6.13 where "everything" should be unicode compatible from what I understand.
Please advice?!
Can't read unicode files, totally stuck at the moment
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Can't read unicode files, totally stuck at the moment
Dear ,
are you totally sure that your file is UNICODE?
For what I know, The file content should be deleted with trying to add an empty string if it is an ANSI file ... and not UNICODE.
Regards
are you totally sure that your file is UNICODE?
For what I know, The file content should be deleted with trying to add an empty string if it is an ANSI file ... and not UNICODE.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Can't read unicode files, totally stuck at the moment
Dear FrancescoT,
I am assuming unicode since there is a BOM of FFFE and each character is 16 bytes:
When read by IA the results are (in the messagebox):
When I try to append an empty line as a workaround the contents of the file is deleted.
I am attaching a file of this type (scesrv.log)
Regards,
I am assuming unicode since there is a BOM of FFFE and each character is 16 bytes:
When read by IA the results are (in the messagebox):
When I try to append an empty line as a workaround the contents of the file is deleted.
I am attaching a file of this type (scesrv.log)
Regards,
- Attachments
-
- scesrv.log
- (876 Bytes) Downloaded 525 times
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Can't read unicode files, totally stuck at the moment
Dear Deploy,
just tried ... use UTF-8 or UTF-8 (without BOM) files instead.
Regards
just tried ... use UTF-8 or UTF-8 (without BOM) files instead.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Can't read unicode files, totally stuck at the moment
FrancescoT wrote:Dear Deploy,
just tried ... use UTF-8 or UTF-8 (without BOM) files instead.
Regards
Dear FrancescoT,
Did not work in your test either I take it?
The output file is from secedit.exe created at runtime when my installer applies security policies as part of the software installation. Are you suggesting that I from within IA somehow could convert the file from original format to something that IA can read? If I had control over the output format to begin with I would not be totally stuck on this

Regards
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Can't read unicode files, totally stuck at the moment
Dear Deploy,
I am just saying that IA 16 or 17 can read an ANSI text file or an Unicode UTF-8 (with or without BOM encoding) text file.
Regards
I am just saying that IA 16 or 17 can read an ANSI text file or an Unicode UTF-8 (with or without BOM encoding) text file.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Can't read unicode files, totally stuck at the moment
Dear FrancescoT,
Just to clarify, is this a bug or is it just that IA will not support "the Microsoft standard" of encoding unicode text in UTF-16? (I get the impression MS uses FFFE, see http://msdn.microsoft.com/en-us/library ... 85%29.aspx)
I am asking because I need to know if I have to write my own code to parse unicode files for results or if I can expect IA to do so in a near future?
Regards
Just to clarify, is this a bug or is it just that IA will not support "the Microsoft standard" of encoding unicode text in UTF-16? (I get the impression MS uses FFFE, see http://msdn.microsoft.com/en-us/library ... 85%29.aspx)
I am asking because I need to know if I have to write my own code to parse unicode files for results or if I can expect IA to do so in a near future?
Regards
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Can't read unicode files, totally stuck at the moment
Dear Deploy,
It is not a bug, but as I said previously, currently only those formats are supported.
I believe that the other formats will be supported in future ... but at the moment, I'm not able to confirm any time frame.
Regards
It is not a bug, but as I said previously, currently only those formats are supported.
I believe that the other formats will be supported in future ... but at the moment, I'm not able to confirm any time frame.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Can't read unicode files, totally stuck at the moment
If there's anyone else stuck due to not being able to read UTF-16 files (typically output from most MS console applications and cmd), here's a quick and dirty solution:
Use "type" to convert to ansi!
It isn't pretty but it works... For example here's how to get the bios serial number. It will be obsolete of course once IA can handle UTF-16 files.
Use "type" to convert to ansi!
It isn't pretty but it works... For example here's how to get the bios serial number. It will be obsolete of course once IA can handle UTF-16 files.
Code: Select all
Run Program wmic.exe /output:c:\tmp\ser.txt bios get serialnumber (WAIT)
Run Program cmd.exe /c type c:\tmp\ser.txt >c:\tmp\serial.txt (WAIT)
Read from Text File c:\tmp\serial.txt into Variable ComputerSerial
Read from Text File c:\tmp\serial.txt into Variable ComputerSerial
Parse String $ComputerSerial$ into Variables ComputerSerial and (Split at first occurrence of pattern)
Convert Variable ComputerSerial to UPPER case
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Can't read unicode files, totally stuck at the moment
thank you for sharing it!
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Who is online
Users browsing this forum: No registered users and 103 guests