4

Closed

UTF-8 files with BOM are not compiled

description

It seems that TypeScript compiler "tsc" just cann't read file in UTF-8 with BOM - such files are created by Visual Studio by default. After that they cann't be compiled by tsc - without any error message. When such file is referenced via "///' comment - tsc treated them as if they are just empty.

It's very annoying - remove BOM manually after each new "*.ts" file creation in VisualStudio.
Closed Nov 5, 2012 at 10:29 PM by mhegazy
This should be fixed in the develop branch with change http://typescript.codeplex.com/SourceControl/changeset/e69ac63a0456

comments

jopamer wrote Oct 5, 2012 at 7:20 PM

Thanks! This is something we're currently looking into.

popopome wrote Oct 8, 2012 at 11:09 PM

I spent several hours to understand what was wrong with my Win8 Project with typescript. It was totally upset after finding BOM issue. Please fix the issue. This is really painful to create/add each TS file within VS.

bigsan wrote Oct 26, 2012 at 10:19 AM

The readFile function in io.ts used Scripting.FileSystemObject to read text file, which supports only system encoding, utf-16 and utf-16 big endian encoding, it causes issues in non-english OS like Chinese, Japanese...!

This can be solved by using ADODB.Stream instead, I've wrote a snippet at https://gist.github.com/3958016