Angular 6 Special characters (Accent and cedilla)

Asked

Viewed 1,350 times

0

Good night, Does anyone know how to solve the problem with Angular 6 accentuation?

    import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'Minha Primeira Aplicação' ;
}

Comes out like this:

Welcome to My First Apply the!

Solved:

When saving in Visual Studio you have to specify that it is to save with UTF-8 with and without signature worked. (File > Save as > Save with encoding(save button has a combo))

1 answer

0

add the tag

 <meta charset="utf-8">

Inside the head of your index.html file

  • Thanks for the answer. I already had the Meta tag with Charset=utf-8, I believe it is something from Typescript or Angular itself.

  • I did a test here and it worked, it can be a configuration of your server. You are using angular-cli?

  • Yes Angular CLI to create the project, and then imported to Visual Studio 2017 to work, the server is the IIS Express of the visual studio

  • must be a configuration of that server.

  • I’ll check here, play straight to IIS, thank you very much, warning if it works

  • I put in IIS, all the configurations UTF-8 and Portuguese Brazil and nothing yet :(

  • It’s not a server, I created a new one with CLI, changed the app.Component and rodei with ng serve --open and gave the same problem. But I already figured out what it is, I opened the component with Notepad++ and changed it to UTF-8 without BOM so it worked, now it’s see in VS how to set up to save like this. Thank you very much for the good will :)

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.