I have actually always been a fan of how .NET did this. The System.String type is opinionated in how it is stored internally and does not allow anyone to change that (unlike Ruby). The conversion from String to byte[] is done using explicit conversion methods like:
- Encoding.UTF8.GetBytes(String) - Encoding.UTF8.GetString(byte[]) - Encoding.UTF32.GetBytes(String) - Encoding.UTF32.GetString(byte[]) - and so on That way if you end up with a bunch of bytes, you know exactly what those bytes represent. On Thu, May 1, 2014 at 4:37 PM, Steve Klabnik <[email protected]>wrote: > Yes, this is what Ruby does, and yes, it causes a lot of tears. It's > one of the biggest things that made the 1.8 -> 1.9 transition > difficult. > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev > -- John Downey
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
