首页 > 解决方案 > C#:如何在一个文件中读取 'éóú' 和 öäü 等字符?

问题描述

标签: c#jsonlocalizationencode

解决方案


The problem is that your text editor saved your fr-fr.json as UTF-8 and your de-de.json as Latin-1 (aka "Default" on your system).

The solution is to save all your JSON files as UTF-8 (since UTF-8 can encode all Unicode characters and has become the new de-facto standard for text files) and always use UTF-8 when reading files.

How to save your JSON file as UTF-8? That depends on your text editor. In Notepad, for example, there's an "Encoding" drop-down box at the bottom of the "Save As" window.


推荐阅读