Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 12, 2012 05:40 PM by Doggy8088
Nov 20, 2009 01:51 PM|LINK
I was modified the *.tt files under "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC\CodeTemplates\AddView" folder. Everytime I Add a new View, the output file encoding are just UTF-8 without BOM. Even I specify
encoding as "ASCII" or "BIG5", the output file encoding still UTF-8 without BOM.
Is that a MVC T4 Host's problem?
t4 MVC bug
Nov 21, 2009 11:46 AM|LINK
Sorry! I forgot to mention the problem I got.
The problem I met is that when the strong-typed Model passed to the View, and the Model Type name contains non-ASCII characters. The view will not able to rendered due to C# compilation errror. That's because the C# compiler doesn't recognize the file
encoding with "UTF-8 without BOM". The C# compiler just treat "UTF-8 without BOM" file as "ASCII" or "Default" encoding, so that the compilation failed.
Does anyone who met this problem before? This problem has plagued me for a while and I think this problem will plague Asian developers too.
Nov 24, 2009 06:12 PM|LINK
I've reported this issue to the folks who work on the MVC tools for Visual Studio so that they can investigate.
Nov 24, 2009 06:23 PM|LINK
Nov 25, 2009 03:54 AM|LINK
Apr 12, 2012 05:40 PM|LINK
This problem still exists. Due to Razor parser unable to parse a file with UTF-8 without BOM encoding with any Unicode characters in the CSHTML file. So any file generated by T4 with some Unicode characters will cause compilation error problem. Which
means there are many T4-like solution such as MvcScaffolding are not able to deal with Unicode TypeName in any project.
Hope can get any response on this issue. Thanks!
Nov 12, 2012 05:40 PM|LINK
This problem was just resolved by unknown reason.