Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbs file encoding UTF8 / UTF16 1

Status
Not open for further replies.

blpcrs

Programmer
Aug 25, 2011
19
US
I Have a bunch of vbs files that are in the UTF8 format stored in Github.
When adding files to github, all the encoding is committed in UTF8, however, I am working with languages, and some of the arrays are in other languages, requiring UTF16 encoding. Does it makes sense to check this in as UTF8 to maintain the github integrity and convert the file to UTF16? (Does that make sense? does that lose anything?) Or just get it checked in as UTF16? Hope that made sense.

thanks in advance.
 
It really depends on whether cscript can understand UTF16 encoded files. Are you talking UTF16 or UCS-2 (what MS calls Unicode).
 
UCS-2LE
The scripts are executed by HP's UFT, which is 16bit. The scripts are stored in GIT as UTF8. Perhaps I should just keep the language files stored in git under UTF16 (UCS-2) rather than in UTF8 and convert the file to UTF16 before execution? (I know it sounds odd, but trying to figure a way out to not mix files in git) Thanks again for the reply!
 
There was a bug with UTF16 on github mentioned in It may have been fixed or it may be outstanding.

git itself works with UCS-2LE files. We have some files in C++ with Arabic, Chinese and Russian, encoded in UCS-2LE and we can get them in and out without any problems. I've never tried it with vbscript. Why not just try one and see. In the worst case, it will be treated as a binary file and you can't get any diffs.
 
Cool, thanks for that info.

Side note, did you need anything special in git "config" or "gitattributes" files for your diffs to not look all spaced out?
 
Which tool are you using for diff? Is it something unixy like vim or meld or is it something like windiff or something else?

Anyway, each tool has its own config for utf16.
 
Using KDiff3 which seems to work well for this case, but github will display "Binary file not shown." in the PR, so no diff is shown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top