C# 在T4模板中使用Unicode
我在T4模板中有一些波斯语字符,但它们都显示为C# 在T4模板中使用Unicode,c#,visual-studio-2010,templates,unicode,t4,C#,Visual Studio 2010,Templates,Unicode,T4,我在T4模板中有一些波斯语字符,但它们都显示为?。我使用template-generator,这是我使用generator的脚本: <#@ template language="C#v4" hostspecific="True" debug="True" #> <#@ assembly name="System.Core" #> <#@ output extension=".cs" encoding="UTF8" #> <#@ include file=
?
。我使用template-generator,这是我使用generator的脚本:
<#@ template language="C#v4" hostspecific="True" debug="True" #>
<#@ assembly name="System.Core" #>
<#@ output extension=".cs" encoding="UTF8" #>
<#@ include file="T4Toolbox.tt" #>
<#@ include file="AllGenerator.tt" #>
<#
AllGenerator generator = new AllGenerator();
generator.DatabaseName = "MyDatabase";
generator.Run();
#>
据我所知,我必须用Unicode保存,但我做不到。当我选择另存为
时,另存类型为
选项只是T4编辑器(*.tbx)
,没有使用Unicode保存的选项。像这样:
那么如何在T4中使用波斯语字符呢?我这边有什么问题吗?这看起来像是您正在使用的T4编辑器加载项中的错误。您可以尝试暂时卸载它。我卸载并重新安装,一切正常,谢谢您的
UTF-8
notUTF8