|
|
|
start date: Tue, 7 Aug 2007 10:20:50 -0400,
posted on: microsoft.public.dotnet.internationalization
back
| Thread Index |
|
1
Bob Bins
|
|
2
Mihai N.
|
|
3
Bob
|
|
4
Michael S. Kaplan [MSFT]
|
utf32 65005 or 12000
If you look at the MSDN sample for Encoding.GetEncoding Method (Int32) it
shows the below sample code..
// Get a UTF-32 encoding by codepage.
Encoding e1 = Encoding.GetEncoding( 65005 );
// Get a UTF-32 encoding by name.
Encoding e2 = Encoding.GetEncoding( "utf-32" );
// Check their equality.
Console.WriteLine( "e1 equals e2? {0}", e1.Equals( e2 ) );
The problem is that the first line throws an exception:
System.NotSupportedException Additional information: No data is available
for encoding 65005.
If I look at the code page property when using the "utf-32" string it says
12000.
Which one is correct? Why does the sample show 65005 as utf-32 when the
function thinks 12000 is the utf32 codepage?
Date:Tue, 7 Aug 2007 10:20:50 -0400
Author:
|
Re: utf32 65005 or 12000
> 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
Date:Tue, 07 Aug 2007 20:35:52 -0700
Author:
|
Re: utf32 65005 or 12000
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." wrote in message
news:Xns9985D18885A6BMihaiN@207.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
Date:Mon, 13 Aug 2007 11:45:49 -0400
Author:
|
Re: utf32 65005 or 12000
Correct.
--
MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap
This posting is provided "AS IS" with
no warranties, and confers no rights.
"Bob" wrote in message
news:%23t47GEc3HHA.3916@TK2MSFTNGP02.phx.gbl...
> 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." wrote in message
> news:Xns9985D18885A6BMihaiN@207.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
>
>
Date:Mon, 13 Aug 2007 20:07:03 -0700
Author:
|
|
|