about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2014-02-05 23:56:27 -0800
committerKevin Ballard <kevin@sb.org>2014-02-06 23:44:26 -0800
commitb0b89a57d5d548155d8a37f5e4b9f11a471bb075 (patch)
treea7bdfd1e6990756d80ca79da11ae6bc07db89299 /src/rustllvm/RustWrapper.cpp
parent6aad3bf944da209d1852c51144ba584de400a10c (diff)
downloadrust-b0b89a57d5d548155d8a37f5e4b9f11a471bb075.tar.gz
rust-b0b89a57d5d548155d8a37f5e4b9f11a471bb075.zip
Add new function str::from_utf8_lossy()
from_utf8_lossy() takes a byte vector and produces a ~str, converting
any invalid UTF-8 sequence into the U+FFFD REPLACEMENT CHARACTER.

The replacement follows the guidelines in ยง5.22 Best Practice for U+FFFD
Substitution from the Unicode Standard (Version 6.2)[1], which also
matches the WHATWG rules for utf-8 decoding[2].

[1]: http://www.unicode.org/versions/Unicode6.2.0/ch05.pdf
[2]: http://encoding.spec.whatwg.org/#utf-8
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions