Yes, decoding the UTF-8 to UTF-16 should mostly work.
On Sat, Oct 5, 2013 at 10:52 PM, Bennie Kloosteman <[email protected]> wrote: > Windows only has 1 shell and it works with other products eg C# and Java so > i think this is a bug .. > > The command shell ( and windows itself) supports Unicode but it must be > usc2 not utf8 , the stack overflow response is not correct as it asumes > Unicode = utf8. > So if you convert to utf16 ( or even better USC2) which should be done on > any windows runtime to be compliant it should be ok. > > As i said C# and java output is ( mostly) correct but they use utf-16 which > is close to USC2 . USC2 cant display a few newer Chinese characters. > > Ben > > > On Fri, Oct 4, 2013 at 11:04 AM, Chris Morgan <[email protected]> wrote: >> >> No, there really is nothing we can do about it while you continue to >> use Command Prompt. Using a different shell is the only way to get it >> to work properly. (And that itself may potentially introduce other >> issues.) >> >> [Note also that you need to reply to all for your response to be on >> the list. You sent it just to me.] >> >> On Fri, Oct 4, 2013 at 11:36 AM, leef huo <[email protected]> wrote: >> > Chris Morgan , thanks . >> > After change the windows code page to 65001,and use Lucida console >> > fonts, >> > there was a slight improvement, the output becomes: >> > but still have problems,it is not entirely correct. >> > >> > Are there a solution now or in the future that makes the rust >> > code(unicode) >> > in the default windows command line to work properly? >> > >> > >> > On Thu, Oct 3, 2013 at 11:24 AM, Chris Morgan <[email protected]> >> > wrote: >> >> >> >> When you're using Command Prompt, you're basically stuck. It doesn't >> >> have any meaningful Unicode support. >> >> >> >> See also >> >> >> >> http://stackoverflow.com/questions/388490/unicode-characters-in-windows-command-line-how >> >> >> >> On Thu, Oct 3, 2013 at 12:50 PM, leef huo <[email protected]> wrote: >> >> > I want to print "hello world, 世界"(Chinese)to the console, but the >> >> > result >> >> > is >> >> > garbled(messy code), the following code where the problem is? >> >> > fn main() { >> >> > let s=~"hello,世界"; >> >> > println(s); >> >> > } >> >> > Should output:hello,世界 >> >> > >> >> > but it print " hello,涓栫晫 " to the console. >> >> > >> >> > OS : windows >> >> > rust : 0.8 >> >> > >> >> > _______________________________________________ >> >> > Rust-dev mailing list >> >> > [email protected] >> >> > https://mail.mozilla.org/listinfo/rust-dev >> >> > >> > >> > >> >> _______________________________________________ >> Rust-dev mailing list >> [email protected] >> https://mail.mozilla.org/listinfo/rust-dev >> > > > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev > _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
