-
Notifications
You must be signed in to change notification settings - Fork 12k
Generated files are not UTF-8 encoded #2077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I did some more tests now and it turns out that even if I manually change the encoding on the .ts and .html files, it seems like it reverts back to ANSI encoding again when webpack compiles it all, at least the .ts files. The problem with angular-cli though is that it seems like there are no webpack.config files to add our own plugins or settings to. Maybe there's a way through angular-cli.json and adding it in "addons" or "packages"? So currently I cannot test if the plugin solves this issue. It would probably be good to add it natively to angular-cli though, since utf-8 encoding should be the base for everything in a modern web project. |
Thanks for answering! Hmm, Yes, Visual Studio 2015 seems to re-save everything in ANSI. I found a "solution" by installing the "ForceUTF8" VS Extension: |
Sorry I can't help you more than this, I don't think there's much we can do on the CLI side :/ |
I have the same problem in CLI when I transfer Dist files to server and use IIS all persian fonts have bad encoding , and They are not UTF8 |
Having the same encoding problem with ng build --prod, fonts encoding is wrong, any solution for this? |
For Spring and Spring Boot Apps, I found the solution here: including these properties resolved the encoding issue for me.spring.messages.encoding=UTF-8
|
Your answer is for Tomcat Web Server. Do you know a solution for IIS ? |
I don't know any solution for IIS, sorry dear. |
No I don't know any solution for IIS, sorry dear. — You are receiving this because you are subscribed to this thread. Reply to this email directly, zasobygwp.pl view it on GitHub , or zasobygwp.pl mute the thread .
|
We have this issue here with files created with the CLI and then imported into visual studio (2015 and 2017). After saving in VS, when looking at the encoding the files claim they are utf-8, however they are in reality encoded in ISO-8859-1. |
For Visual Studio 2017, I solved this by turning off Auto-detect UTF-8 encoding without signature and Follow project coding conventions. Got to: Tools | Options | Text Editor | General: then uncheck Auto-detect UTF-8 encoding without signature and Follow project coding conventions. |
This will make Visual Studio incorrectly display non-ASCII characters in files that were saved without BOM. I usually want to leave "Auto-detect UTF-8 encoding" enabled, otherwise when I open a file with non-ASCII multibyte characters in Visual Studio and save it, VS decides its ASCII and corrupts the non-ASCII multibyte characters. So, in general this solution does not work. I don't know a clean way to force Visual Studio to automatically save non-BOM as UTF8 if you happen to be the first person to add non-ASCII characters to the file. I just tested - in such scenario, VS saves non-ASCII chars as a single byte. You have to manually resave the file picking UTF8 without BOM in VS to make it work correctly. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Win10
Versions. Please run
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: win32 x64
Repro steps. Was this an app that wasn't created using the CLI? What change did you
do on your code? etc.
Generate a component or a new project. The files do not support UTF-8 chars, like åäö (Swedish). When rendered in HTML they appear as symbols. Changing the file encoding to UTF-8 (with or without BOM) fixes this.
The log given by the failure. Normally this include a stack trace and some
more information.
N/A
Mention any other details that might be useful.
See step 3.
The text was updated successfully, but these errors were encountered: