File Encoding
In order for computers to understand each other and to be able to represent the large amount of different languages characters and symbols, encodings are needed. Encodings are a way of defining a set where numbers correspond to a certain symbol.
Supported File Encodings
We support the following encodings (and only these, see below)
UTF8
We strongly recommend you to stick to UTF-8 as this is the most common used character encoding for the web and it is also the recommended encoding in the HTML 5 Specification.
Here is a good explanation from YouTuber Alex that explains UTF-8 encoding.
In Practice
You can use multiple common tools or programming languages in order to create UTF-8 encoded files.
Using a Text Editor
- Open your file in a good text editor like Sublime Text
- Click File in the top-left corner
- Click
Save with Encoding...
- Click
UTF-8
Using Programming
- Python
- C#
- Java
- Rust
from pathlib import Path
file_path.write_text(content, "utf-8")
var utf8WithoutBom = new System.Text.UTF8Encoding(false);
File.WriteAllText(_fileName, content, utf8WithoutBom);
try (
FileOutputStream fos = new FileOutputStream(file);
OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
BufferedWriter writer = new BufferedWriter(osw)) {
writer.append(line);
}
use std::fs::File;
let mut file = File::create(file_name)?;
file.write_all(b"content")?;
Why Not More Encodings?
There are multiple other encodings not listed above. We do not support sending us files using other encodings than the list above. This is a decision taken weighing in complexity vs benefit vs error proneness.