On 1 May 2014 22:42, Tony Arcieri <[email protected]> wrote:
> No, when you combine strings with different encodings, you need to transcode
> one of the strings. When this happens, the transcoding process may encounter
> some characters which are valid in one encoding, but not another, in which
> case the transcoding will fail, and it will fail at runtime.

I have not my clear enough then.

The transcoding needs to happen only at the time when you "flatten"
the rope into a single encoding. And yes, it may then fail if you
attempt to encode into a non-unicode encoding.

That is, it is perfectly valid to have a rope that consists of strings
in different encodings.

> This can happen long after a string has crossed the I/O boundary. The result
> is errors which pop up at runtime in odd circumstances. This is nothing
> short of a fucking nightmare to debug.

I agree if that was the case, but it is not. The only time that a
run-time error can happen is when you use the "encode" operation which
flattens the rope into a single byte stream of a particular encoding.

Also, I don't think that string encoding bugs qualify as nightmares –
with all respect. I can think of other scenarios that are several
orders of magnitude more troubling.

\malthe
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to