2022-07-08 11:08:32 -05:00
|
|
|
//@only-windows
|
2020-05-30 11:46:26 -05:00
|
|
|
|
|
|
|
use std::ffi::{OsStr, OsString};
|
2022-06-21 01:40:39 -05:00
|
|
|
use std::os::windows::ffi::{OsStrExt, OsStringExt};
|
2020-05-30 11:46:26 -05:00
|
|
|
|
|
|
|
fn test1() {
|
|
|
|
let base = "a\té \u{7f}💩\r";
|
|
|
|
let mut base: Vec<u16> = OsStr::new(base).encode_wide().collect();
|
|
|
|
base.push(0xD800);
|
|
|
|
let _res = OsString::from_wide(&base);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test2() {
|
|
|
|
let mut base: Vec<u16> = OsStr::new("aé ").encode_wide().collect();
|
|
|
|
base.push(0xD83D);
|
|
|
|
let mut _res: Vec<u16> = OsString::from_wide(&base).encode_wide().collect();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
test1();
|
|
|
|
test2();
|
|
|
|
}
|