E0072
Source that is not valid UTF-8
ErrorA source file must be text in UTF-8. The error points at the first byte that is not.
Why
Sisu reads every source file as UTF-8, so that a column and a string mean the same thing in every editor. A file saved in another encoding, such as Latin-1, stores a character like é as a byte that UTF-8 does not allow there.
Broken
The file below, saved in Latin-1:
fn main() {
// café
print(1)
}
What sisu says
error[E0072]: source is not valid UTF-8 --> E0072.sisu:2:11 | 2 | // caf� | ^ | = help: save the file as UTF-8 sisu: 1 error sisu: for more on a code, run `sisu explain <code>`: E0072
Fixed
The same file, saved in UTF-8:
fn main() {
// café
print(1)
}
Sisu