Matze
Matze

Reputation: 5508

Transpiled JavaScript output contains invalid characters in literals

I have a field definition in TypeScript that looks like that:

languages: Array<{}> = [{ key: "fr", name: "français" }];

When the TypeScript file gets compiled the output in the JavaScript looks like:

this.languages = [{ key: "fr", name: "fran�ais" }];

Why does the transpiler change the literals and how can I prevent that?

Upvotes: 1

Views: 102

Answers (1)

Matze
Matze

Reputation: 5508

Ah, got it by myself...

The TypeScript file was saved using the default Western European (Windows) - Codepage 1252 encoding; I changed that to Unicode (UTF-8 with signature) - Codepage 65001) which fixed the problem.

Upvotes: 1

Related Questions