ligershark / CoreTemplatePack

A collection of .NET Core project templates
Other
82 stars 17 forks source link

UTF 8 characters don't render in AngularJS 2 template #9

Open Elvin1492 opened 7 years ago

Elvin1492 commented 7 years ago

We create angularJS2 application. In some component utf8 character shown normally but some don't. Specially templates that come from router-outlet. I think this extension has some bugs.

SteveSandersonMS commented 7 years ago

For issues specifically with the Angular template, would you be able to post them to https://github.com/aspnet/JavaScriptServices/issues? That's where we're building the template contents.

In this case, please be sure to provide repro steps. I'm not sure how to create the problem you've described (I just tried for example putting the character 'Ꮿ' in the middle of one of the templates in the generated Angular 2 app, and it rendered fine).

HugCoder commented 7 years ago

I'm pretty sure this has nothing to do with the extension, but is because of Visual Studio for some reason always saving files in ANSI, not UTF8. There's another extension that solves this though, called ForceUTF8. You can find it here: https://marketplace.visualstudio.com/items?itemName=vilicvane.ForceUTF8 or https://marketplace.visualstudio.com/items?itemName=jz5.ForceUTF8withBOM Use the latter if you need UTF8 with BOM. Both should do, but I tried with BOM and it worked in my case. I haven't tried it with this extension though, so cannot promise that it solves your particular problem.

If you use Visual Studio Code, it saves in UTF8, so it's no problem. Visual Studio, however, doesn't seem to not understand the issue of forcing ANSI on the world though.