The realities of IRC in the year of 2026 appear to be that there are still folks that prefer using their ISO-8859-1 or some other abomination of an encoding. These people on a server that is widely utf-8. The resulting mismatch leads to unparsed messages from the irc crate, as the encoding is specified per config (eg per server).
It would be useful if I could make my irc client more forgiving by allowing lossy decoding.
Right now, if I were to use a fork of the irc crate, I could just replace String::from_utf8() with `String::from_utf8_lossy().
Would there be an interest in specifying an lossy-encoding feature such that others can make use of it?
Cf.
|
match String::from_utf8(line.to_vec()) { |
The realities of IRC in the year of 2026 appear to be that there are still folks that prefer using their ISO-8859-1 or some other abomination of an encoding. These people on a server that is widely utf-8. The resulting mismatch leads to unparsed messages from the irc crate, as the encoding is specified per config (eg per server).
It would be useful if I could make my irc client more forgiving by allowing lossy decoding.
Right now, if I were to use a fork of the irc crate, I could just replace
String::from_utf8()with `String::from_utf8_lossy().Would there be an interest in specifying an lossy-encoding feature such that others can make use of it?
Cf.
irc/irc-proto/src/line.rs
Line 67 in 269b517