![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
If you look at the MSDN sample for Encoding.GetEncoding Method (Int32) it shows the below sample code.. .... Which one is correct? Why does the sample show 65005 as utf-32 when the function thinks 12000 is the utf32 codepage? |
#3
| |||
| |||
|
|
If you look at the MSDN sample for Encoding.GetEncoding Method (Int32) it shows the below sample code.. ... Which one is correct? Why does the sample show 65005 as utf-32 when the function thinks 12000 is the utf32 codepage? 12000 is UTF-32LE (little-endian) and 12001 is UTF-32BE (big-endian), if you still want to go by codepage. But I find that getting the encoder by name (or using Encoding.UTF32) is much more readable than 12000 I tend to use the System.Text.UTF32Encoding, because it gives me control on byte-endiannes and BOM. -- Mihai Nita [Microsoft MVP, Windows - SDK] http://www.mihai-nita.net ------------------------------------------ Replace _year_ with _ to get the real email |
#4
| |||
| |||
|
|
So the sample is just a documentation bug/error? // Get a UTF-32 encoding by codepage. Encoding e1 = Encoding.GetEncoding( 65005 ); http://msdn2.microsoft.com/en-us/library/wzsz3bk3.aspx "Mihai N." <nmihai_year_2000 (AT) yahoo (DOT) com> wrote in message news:Xns9985D18885A6BMihaiN (AT) 207 (DOT) 46.248.16... If you look at the MSDN sample for Encoding.GetEncoding Method (Int32) it shows the below sample code.. ... Which one is correct? Why does the sample show 65005 as utf-32 when the function thinks 12000 is the utf32 codepage? 12000 is UTF-32LE (little-endian) and 12001 is UTF-32BE (big-endian), if you still want to go by codepage. But I find that getting the encoder by name (or using Encoding.UTF32) is much more readable than 12000 I tend to use the System.Text.UTF32Encoding, because it gives me control on byte-endiannes and BOM. -- Mihai Nita [Microsoft MVP, Windows - SDK] http://www.mihai-nita.net ------------------------------------------ Replace _year_ with _ to get the real email |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |