HighTechTalks DotNet Forums  

System.Text.Latin1Encoding

Dotnet Internationalization microsoft.public.dotnet.internationalization


Discuss System.Text.Latin1Encoding in the Dotnet Internationalization forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Harlan Messinger
 
Posts: n/a

Default System.Text.Latin1Encoding - 01-24-2006 , 02:32 PM






In an app I use the following statement in a class called Application:

public static readonly System.Text.Encoding defaultEncoding =
System.Text.Encoding.GetEncoding("iso-8859-1");

When debugging, if I type the following in the command window:

Debug.Print Application.defaultEncoding

I get a list of data beginning with the following lines.

{System.Text.Latin1Encoding}
[System.Text.Latin1Encoding]: {System.Text.Latin1Encoding}
System.Object: {System.Text.Latin1Encoding}
ASCII: {System.Text.ASCIIEncoding}
asciiEncoding: {System.Text.ASCIIEncoding}
BigEndianUnicode: {System.Text.UnicodeEncoding}
bigEndianUnicode: {System.Text.UnicodeEncoding}
BodyName: "iso-8859-1"
ChineseSimp: 52936

Apparently there is something called System.Text.Latin1Encoding, but
this appears not to be accessible to the developer, so I guess it's
private or protected. Why would this and all the other traditional
encodings not have been made directly available in the same way as
System.Text.UTF8Encoding, rather than requiring us to rely on a
character string to get the encoding we want?

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default RE: System.Text.Latin1Encoding - 02-17-2006 , 06:02 PM






Hi Harlan. I'd need to ask the architect to know for sure, but my guess is
that they wanted to add a level of abstraction. The .NET Framework relies
on the operating system for the full list of available encodings, and this
can vary depending on the OS and its configuration. For example, Latin1 may
be available on all versions of Windows, but encodings such as 'ISCII
Devanagri' or 'TeleText Taiwan' may not be.

(Also, imagine trying to select one of these from an IntelliSense list 140
members long...)

Garrett McGowan [MSFT Developer International]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------
Quote:
From: Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net
Newsgroups: microsoft.public.dotnet.internationalization
Subject: System.Text.Latin1Encoding
Date: Tue, 24 Jan 2006 14:32:03 -0500

In an app I use the following statement in a class called Application:

public static readonly System.Text.Encoding defaultEncoding =
System.Text.Encoding.GetEncoding("iso-8859-1");

When debugging, if I type the following in the command window:

Debug.Print Application.defaultEncoding

I get a list of data beginning with the following lines.

{System.Text.Latin1Encoding}
[System.Text.Latin1Encoding]: {System.Text.Latin1Encoding}
System.Object: {System.Text.Latin1Encoding}
ASCII: {System.Text.ASCIIEncoding}
asciiEncoding: {System.Text.ASCIIEncoding}
BigEndianUnicode: {System.Text.UnicodeEncoding}
bigEndianUnicode: {System.Text.UnicodeEncoding}
BodyName: "iso-8859-1"
ChineseSimp: 52936

Apparently there is something called System.Text.Latin1Encoding, but
this appears not to be accessible to the developer, so I guess it's
private or protected. Why would this and all the other traditional
encodings not have been made directly available in the same way as
System.Text.UTF8Encoding, rather than requiring us to rely on a
character string to get the encoding we want?



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.