mirror of
https://github.com/claunia/Claunia.Encoding.git
synced 2025-12-16 19:24:43 +00:00
Added code to get a list of available encodings.
This commit is contained in:
@@ -37,6 +37,7 @@
|
|||||||
<Compile Include="LisaRoman.cs" />
|
<Compile Include="LisaRoman.cs" />
|
||||||
<Compile Include="ATASCII.cs" />
|
<Compile Include="ATASCII.cs" />
|
||||||
<Compile Include="AtariST.cs" />
|
<Compile Include="AtariST.cs" />
|
||||||
|
<Compile Include="GetEncs.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
|
|||||||
56
Claunia.Encoding.Tests/GetEncs.cs
Normal file
56
Claunia.Encoding.Tests/GetEncs.cs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
//
|
||||||
|
// GetEncs.cs
|
||||||
|
//
|
||||||
|
// Author:
|
||||||
|
// Natalia Portillo <claunia@claunia.com>
|
||||||
|
//
|
||||||
|
// Copyright (c) 2017 Copyright © Claunia.com
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
// THE SOFTWARE.
|
||||||
|
using System;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace Claunia.Encoding.Tests
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class GetEncs
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
// Well basically this is taken from MSDN's documentation :p
|
||||||
|
public void GetAllEncs()
|
||||||
|
{
|
||||||
|
// Print the header.
|
||||||
|
Console.Write("CodePage identifier and name ");
|
||||||
|
Console.Write("BrDisp BrSave ");
|
||||||
|
Console.Write("MNDisp MNSave ");
|
||||||
|
Console.WriteLine("1-Byte ReadOnly ");
|
||||||
|
|
||||||
|
// For every encoding, get the property values.
|
||||||
|
foreach(EncodingInfo ei in Encoding.GetEncodings())
|
||||||
|
{
|
||||||
|
Encoding e = ei.GetEncoding();
|
||||||
|
|
||||||
|
Console.Write("{0,-6} {1,-25} ", ei.CodePage, ei.Name);
|
||||||
|
Console.Write("{0,-8} {1,-8} ", e.IsBrowserDisplay, e.IsBrowserSave);
|
||||||
|
Console.Write("{0,-8} {1,-8} ", e.IsMailNewsDisplay, e.IsMailNewsSave);
|
||||||
|
Console.WriteLine("{0,-8} {1,-8} ", e.IsSingleByte, e.IsReadOnly);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,7 +31,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an ATARI Standard Code for Information Interchange character encoding of Unicode characters.
|
/// Represents an ATARI Standard Code for Information Interchange character encoding of Unicode characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ATASCII : System.Text.Encoding
|
public class ATASCII : Encoding
|
||||||
{
|
{
|
||||||
const string _bodyname = "atascii";
|
const string _bodyname = "atascii";
|
||||||
const int _codepage = 0;
|
const int _codepage = 0;
|
||||||
@@ -50,28 +50,28 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserDisplay {
|
public override bool IsBrowserDisplay {
|
||||||
get { return browserDisplay; }
|
get { return browserDisplay; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserSave {
|
public override bool IsBrowserSave {
|
||||||
get { return browserSave; }
|
get { return browserSave; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsDisplay {
|
public override bool IsMailNewsDisplay {
|
||||||
get { return mailNewsDisplay; }
|
get { return mailNewsDisplay; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsSave {
|
public override bool IsMailNewsSave {
|
||||||
get { return mailNewsSave; }
|
get { return mailNewsSave; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,35 +79,35 @@ namespace Claunia.Encoding
|
|||||||
/// Gets a value indicating whether the current encoding is read-only.
|
/// Gets a value indicating whether the current encoding is read-only.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The is single byte.</value>
|
/// <value>The is single byte.</value>
|
||||||
public bool IsReadOnly {
|
public override bool IsReadOnly {
|
||||||
get { return readOnly; }
|
get { return readOnly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSingleByte {
|
public override bool IsSingleByte {
|
||||||
get { return singleByte; }
|
get { return singleByte; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the code page identifier of the current Encoding.
|
/// Gets the code page identifier of the current Encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CodePage {
|
public override int CodePage {
|
||||||
get { return _codepage; }
|
get { return _codepage; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent body tags
|
/// Gets a name for the current encoding that can be used with mail agent body tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BodyName {
|
public override string BodyName {
|
||||||
get { return _bodyname; }
|
get { return _bodyname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent header tags
|
/// Gets a name for the current encoding that can be used with mail agent header tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string HeaderName {
|
public override string HeaderName {
|
||||||
get { return _headername; }
|
get { return _headername; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,14 +121,14 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the human-readable description of the current encoding.
|
/// Gets the human-readable description of the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string EncodingName {
|
public override string EncodingName {
|
||||||
get { return _encodingname; }
|
get { return _encodingname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int WindowsCodePage {
|
public override int WindowsCodePage {
|
||||||
get { return _windowsCodepage; }
|
get { return _windowsCodepage; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace Claunia.Encoding
|
|||||||
/// Represents an Atari ST character encoding of Unicode characters.
|
/// Represents an Atari ST character encoding of Unicode characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// TODO: 0x09 => U+1F552, 0x0A => U+1F514
|
// TODO: 0x09 => U+1F552, 0x0A => U+1F514
|
||||||
public class AtariST : System.Text.Encoding
|
public class AtariST : Encoding
|
||||||
{
|
{
|
||||||
const string _bodyname = "atarist";
|
const string _bodyname = "atarist";
|
||||||
const int _codepage = 0;
|
const int _codepage = 0;
|
||||||
@@ -51,28 +51,28 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserDisplay {
|
public override bool IsBrowserDisplay {
|
||||||
get { return browserDisplay; }
|
get { return browserDisplay; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserSave {
|
public override bool IsBrowserSave {
|
||||||
get { return browserSave; }
|
get { return browserSave; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsDisplay {
|
public override bool IsMailNewsDisplay {
|
||||||
get { return mailNewsDisplay; }
|
get { return mailNewsDisplay; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsSave {
|
public override bool IsMailNewsSave {
|
||||||
get { return mailNewsSave; }
|
get { return mailNewsSave; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,35 +80,35 @@ namespace Claunia.Encoding
|
|||||||
/// Gets a value indicating whether the current encoding is read-only.
|
/// Gets a value indicating whether the current encoding is read-only.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The is single byte.</value>
|
/// <value>The is single byte.</value>
|
||||||
public bool IsReadOnly {
|
public override bool IsReadOnly {
|
||||||
get { return readOnly; }
|
get { return readOnly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSingleByte {
|
public override bool IsSingleByte {
|
||||||
get { return singleByte; }
|
get { return singleByte; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the code page identifier of the current Encoding.
|
/// Gets the code page identifier of the current Encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CodePage {
|
public override int CodePage {
|
||||||
get { return _codepage; }
|
get { return _codepage; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent body tags
|
/// Gets a name for the current encoding that can be used with mail agent body tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BodyName {
|
public override string BodyName {
|
||||||
get { return _bodyname; }
|
get { return _bodyname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent header tags
|
/// Gets a name for the current encoding that can be used with mail agent header tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string HeaderName {
|
public override string HeaderName {
|
||||||
get { return _headername; }
|
get { return _headername; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,14 +122,14 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the human-readable description of the current encoding.
|
/// Gets the human-readable description of the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string EncodingName {
|
public override string EncodingName {
|
||||||
get { return _encodingname; }
|
get { return _encodingname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int WindowsCodePage {
|
public override int WindowsCodePage {
|
||||||
get { return _windowsCodepage; }
|
get { return _windowsCodepage; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
<Compile Include="ZX80.cs" />
|
<Compile Include="ZX80.cs" />
|
||||||
<Compile Include="ZX81.cs" />
|
<Compile Include="ZX81.cs" />
|
||||||
<Compile Include="ZXSpectrum.cs" />
|
<Compile Include="ZXSpectrum.cs" />
|
||||||
|
<Compile Include="EncodingInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="..\LICENSE.MIT">
|
<EmbeddedResource Include="..\LICENSE.MIT">
|
||||||
@@ -73,14 +74,8 @@
|
|||||||
<MonoDevelop>
|
<MonoDevelop>
|
||||||
<Properties>
|
<Properties>
|
||||||
<Policies>
|
<Policies>
|
||||||
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-csharp">
|
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-csharp" />
|
||||||
<inheritsSet />
|
<CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="True" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" NewLinesForBracesInProperties="False" NewLinesForBracesInAccessors="False" NewLinesForBracesInAnonymousMethods="False" NewLinesForBracesInControlBlocks="False" NewLinesForBracesInAnonymousTypes="False" NewLinesForBracesInObjectCollectionArrayInitializers="False" NewLinesForBracesInLambdaExpressionBody="False" NewLineForElse="False" NewLineForCatch="False" NewLineForFinally="False" NewLineForMembersInObjectInit="False" NewLineForMembersInAnonymousTypes="False" NewLineForClausesInQuery="False" SpacingAfterMethodDeclarationName="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceAfterMethodCallName="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceAfterControlFlowStatementKeyword="False" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBeforeOpenSquareBracket="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeColonInBaseTypeDeclaration="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" scope="text/x-csharp" />
|
||||||
<inheritsScope />
|
|
||||||
</TextStylePolicy>
|
|
||||||
<CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="True" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" NewLineForMembersInObjectInit="False" NewLineForMembersInAnonymousTypes="False" NewLineForClausesInQuery="False" SpacingAfterMethodDeclarationName="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceAfterMethodCallName="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceAfterControlFlowStatementKeyword="False" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBeforeOpenSquareBracket="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeColonInBaseTypeDeclaration="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" NewLinesForBracesInProperties="False" NewLinesForBracesInAccessors="False" NewLinesForBracesInAnonymousMethods="False" NewLinesForBracesInControlBlocks="False" NewLinesForBracesInAnonymousTypes="False" NewLinesForBracesInObjectCollectionArrayInitializers="False" NewLinesForBracesInLambdaExpressionBody="False" NewLineForElse="False" NewLineForCatch="False" NewLineForFinally="False" scope="text/x-csharp">
|
|
||||||
<inheritsSet />
|
|
||||||
<inheritsScope />
|
|
||||||
</CSharpFormattingPolicy>
|
|
||||||
</Policies>
|
</Policies>
|
||||||
</Properties>
|
</Properties>
|
||||||
</MonoDevelop>
|
</MonoDevelop>
|
||||||
|
|||||||
@@ -24,12 +24,16 @@
|
|||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
// THE SOFTWARE.
|
// THE SOFTWARE.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This class contains static instances of the supported encodings.
|
/// This class contains static instances of the supported encodings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Encoding
|
public abstract class Encoding : System.Text.Encoding
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Static instance for the LisaRoman encoding
|
/// Static instance for the LisaRoman encoding
|
||||||
@@ -47,6 +51,85 @@ namespace Claunia.Encoding
|
|||||||
/// Static instance for the PETSCII encoding
|
/// Static instance for the PETSCII encoding
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static System.Text.Encoding PETEncoding = new PETSCII();
|
public static System.Text.Encoding PETEncoding = new PETSCII();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns an array that contains all encodings.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>An array that contains all encodings.</returns>
|
||||||
|
public static EncodingInfo[] GetEncodings()
|
||||||
|
{
|
||||||
|
List<EncodingInfo> encodings = new List<EncodingInfo>();
|
||||||
|
|
||||||
|
foreach(Type type in Assembly.GetExecutingAssembly().GetTypes()) {
|
||||||
|
if(type.IsSubclassOf(typeof(Encoding))) {
|
||||||
|
Encoding filter = (Encoding)type.GetConstructor(new Type[] {}).Invoke(new object[] { });
|
||||||
|
encodings.Add(new EncodingInfo(filter.CodePage, filter.BodyName, filter.EncodingName, false, type));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return encodings.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
||||||
|
/// </summary>
|
||||||
|
public abstract bool IsBrowserDisplay { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
||||||
|
/// </summary>
|
||||||
|
public abstract bool IsBrowserSave{ get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
||||||
|
/// </summary>
|
||||||
|
public abstract bool IsMailNewsDisplay{ get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
||||||
|
/// </summary>
|
||||||
|
public abstract bool IsMailNewsSave{ get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the current encoding is read-only.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The is single byte.</value>
|
||||||
|
public abstract bool IsReadOnly{ get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
||||||
|
/// </summary>
|
||||||
|
public abstract bool IsSingleByte{ get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the code page identifier of the current Encoding.
|
||||||
|
/// </summary>
|
||||||
|
public abstract int CodePage{ get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a name for the current encoding that can be used with mail agent body tags
|
||||||
|
/// </summary>
|
||||||
|
public abstract string BodyName{ get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a name for the current encoding that can be used with mail agent header tags
|
||||||
|
/// </summary>
|
||||||
|
public abstract string HeaderName{ get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ggets the name registered with the Internet Assigned Numbers Authority (IANA) for the current encoding.
|
||||||
|
/// </summary>
|
||||||
|
public abstract override string WebName{ get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the human-readable description of the current encoding.
|
||||||
|
/// </summary>
|
||||||
|
public abstract string EncodingName{ get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
||||||
|
/// </summary>
|
||||||
|
public abstract int WindowsCodePage{ get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
91
Claunia.Encoding/EncodingInfo.cs
Normal file
91
Claunia.Encoding/EncodingInfo.cs
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
// Licensed to the .NET Foundation under one or more agreements.
|
||||||
|
// The .NET Foundation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Claunia.Encoding
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Provides basic information about an encoding.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class EncodingInfo
|
||||||
|
{
|
||||||
|
private int iCodePage; // Code Page #
|
||||||
|
private string strEncodingName; // Short name (web name)
|
||||||
|
private string strDisplayName; // Full localized name
|
||||||
|
private bool isSystem;
|
||||||
|
private Type thisType;
|
||||||
|
|
||||||
|
internal EncodingInfo(int codePage, string name, string displayName, bool system = true, Type internalType = null)
|
||||||
|
{
|
||||||
|
iCodePage = codePage;
|
||||||
|
strEncodingName = name;
|
||||||
|
strDisplayName = displayName;
|
||||||
|
isSystem = system;
|
||||||
|
thisType = internalType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the code page identifier of the encoding.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The code page identifier of the encoding.</value>
|
||||||
|
public int CodePage {
|
||||||
|
get {
|
||||||
|
return iCodePage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name registered with the Internet Assigned Numbers Authority (IANA) for the encoding.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The IANA name for the encoding. For more information about the IANA, see www.iana.org.</value>
|
||||||
|
public string Name {
|
||||||
|
get {
|
||||||
|
return strEncodingName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the human-readable description of the encoding.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The human-readable description of the encoding.</value>
|
||||||
|
public string DisplayName {
|
||||||
|
get {
|
||||||
|
return strDisplayName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a Encoding object that corresponds to the current EncodingInfo object.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A <see cref="T:Claunia.Encoding.Encoding"/> object that corresponds to the current <see cref="T:Claunia.Encoding.EncodingInfo"/> object.</returns>
|
||||||
|
public Encoding GetEncoding()
|
||||||
|
{
|
||||||
|
return (Encoding)thisType.GetConstructor(new Type[] { }).Invoke(new object[] { });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the specified object is equal to the current EncodingInfo object.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">An object to compare to the current <see cref="T:Claunia.Encoding.EncodingInfo"/> object.</param>
|
||||||
|
/// <returns><c>true</c> if value is a <see cref="T:Claunia.Encoding.EncodingInfo"/> and is equal to the current <see cref="T:Claunia.Encoding.EncodingInfo"/>; otherwise, <c>false</c>.</returns>
|
||||||
|
public override bool Equals(Object value)
|
||||||
|
{
|
||||||
|
EncodingInfo that = value as EncodingInfo;
|
||||||
|
if(that != null) {
|
||||||
|
return (this.CodePage == that.CodePage);
|
||||||
|
}
|
||||||
|
return (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the hash code for the current EncodingInfo object.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A 32-bit signed integer hash code.</returns>
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return this.CodePage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,7 +31,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an Apple Lisa character encoding of Unicode characters.
|
/// Represents an Apple Lisa character encoding of Unicode characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LisaRoman : System.Text.Encoding
|
public class LisaRoman : Encoding
|
||||||
{
|
{
|
||||||
const string _bodyname = "lisa";
|
const string _bodyname = "lisa";
|
||||||
const int _codepage = 0;
|
const int _codepage = 0;
|
||||||
@@ -50,28 +50,28 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserDisplay {
|
public override bool IsBrowserDisplay {
|
||||||
get { return browserDisplay; }
|
get { return browserDisplay; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserSave {
|
public override bool IsBrowserSave {
|
||||||
get { return browserSave; }
|
get { return browserSave; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsDisplay {
|
public override bool IsMailNewsDisplay {
|
||||||
get { return mailNewsDisplay; }
|
get { return mailNewsDisplay; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsSave {
|
public override bool IsMailNewsSave {
|
||||||
get { return mailNewsSave; }
|
get { return mailNewsSave; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,35 +79,35 @@ namespace Claunia.Encoding
|
|||||||
/// Gets a value indicating whether the current encoding is read-only.
|
/// Gets a value indicating whether the current encoding is read-only.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The is single byte.</value>
|
/// <value>The is single byte.</value>
|
||||||
public bool IsReadOnly {
|
public override bool IsReadOnly {
|
||||||
get { return readOnly; }
|
get { return readOnly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSingleByte {
|
public override bool IsSingleByte {
|
||||||
get { return singleByte; }
|
get { return singleByte; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the code page identifier of the current Encoding.
|
/// Gets the code page identifier of the current Encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CodePage {
|
public override int CodePage {
|
||||||
get { return _codepage; }
|
get { return _codepage; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent body tags
|
/// Gets a name for the current encoding that can be used with mail agent body tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BodyName {
|
public override string BodyName {
|
||||||
get { return _bodyname; }
|
get { return _bodyname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent header tags
|
/// Gets a name for the current encoding that can be used with mail agent header tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string HeaderName {
|
public override string HeaderName {
|
||||||
get { return _headername; }
|
get { return _headername; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,14 +121,14 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the human-readable description of the current encoding.
|
/// Gets the human-readable description of the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string EncodingName {
|
public override string EncodingName {
|
||||||
get { return _encodingname; }
|
get { return _encodingname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int WindowsCodePage {
|
public override int WindowsCodePage {
|
||||||
get { return _windowsCodepage; }
|
get { return _windowsCodepage; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an Commodore PET Standard Code for Information Interchange (aka CBM ASCII) character encoding of Unicode characters.
|
/// Represents an Commodore PET Standard Code for Information Interchange (aka CBM ASCII) character encoding of Unicode characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PETSCII : System.Text.Encoding
|
public class PETSCII : Encoding
|
||||||
{
|
{
|
||||||
const string _bodyname = "petscii";
|
const string _bodyname = "petscii";
|
||||||
const int _codepage = 0;
|
const int _codepage = 0;
|
||||||
@@ -50,7 +50,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserDisplay
|
public override bool IsBrowserDisplay
|
||||||
{
|
{
|
||||||
get { return browserDisplay; }
|
get { return browserDisplay; }
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserSave
|
public override bool IsBrowserSave
|
||||||
{
|
{
|
||||||
get { return browserSave; }
|
get { return browserSave; }
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsDisplay
|
public override bool IsMailNewsDisplay
|
||||||
{
|
{
|
||||||
get { return mailNewsDisplay; }
|
get { return mailNewsDisplay; }
|
||||||
}
|
}
|
||||||
@@ -74,7 +74,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsSave
|
public override bool IsMailNewsSave
|
||||||
{
|
{
|
||||||
get { return mailNewsSave; }
|
get { return mailNewsSave; }
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding is read-only.
|
/// Gets a value indicating whether the current encoding is read-only.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsReadOnly
|
public override bool IsReadOnly
|
||||||
{
|
{
|
||||||
get { return readOnly; }
|
get { return readOnly; }
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSingleByte
|
public override bool IsSingleByte
|
||||||
{
|
{
|
||||||
get { return singleByte; }
|
get { return singleByte; }
|
||||||
}
|
}
|
||||||
@@ -98,7 +98,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the code page identifier of the current Encoding.
|
/// Gets the code page identifier of the current Encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CodePage
|
public override int CodePage
|
||||||
{
|
{
|
||||||
get { return _codepage; }
|
get { return _codepage; }
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent body tags
|
/// Gets a name for the current encoding that can be used with mail agent body tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BodyName
|
public override string BodyName
|
||||||
{
|
{
|
||||||
get { return _bodyname; }
|
get { return _bodyname; }
|
||||||
}
|
}
|
||||||
@@ -114,7 +114,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent header tags
|
/// Gets a name for the current encoding that can be used with mail agent header tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string HeaderName
|
public override string HeaderName
|
||||||
{
|
{
|
||||||
get { return _headername; }
|
get { return _headername; }
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the human-readable description of the current encoding.
|
/// Gets the human-readable description of the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string EncodingName
|
public override string EncodingName
|
||||||
{
|
{
|
||||||
get { return _encodingname; }
|
get { return _encodingname; }
|
||||||
}
|
}
|
||||||
@@ -138,7 +138,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int WindowsCodePage
|
public override int WindowsCodePage
|
||||||
{
|
{
|
||||||
get { return _windowsCodepage; }
|
get { return _windowsCodepage; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a ZX80 character encoding of Unicode characters.
|
/// Represents a ZX80 character encoding of Unicode characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ZX80 : System.Text.Encoding
|
public class ZX80 : Encoding
|
||||||
{
|
{
|
||||||
const string _bodyname = "zx80";
|
const string _bodyname = "zx80";
|
||||||
const int _codepage = 0;
|
const int _codepage = 0;
|
||||||
@@ -50,28 +50,28 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserDisplay {
|
public override bool IsBrowserDisplay {
|
||||||
get { return browserDisplay; }
|
get { return browserDisplay; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserSave {
|
public override bool IsBrowserSave {
|
||||||
get { return browserSave; }
|
get { return browserSave; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsDisplay {
|
public override bool IsMailNewsDisplay {
|
||||||
get { return mailNewsDisplay; }
|
get { return mailNewsDisplay; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsSave {
|
public override bool IsMailNewsSave {
|
||||||
get { return mailNewsSave; }
|
get { return mailNewsSave; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,35 +79,35 @@ namespace Claunia.Encoding
|
|||||||
/// Gets a value indicating whether the current encoding is read-only.
|
/// Gets a value indicating whether the current encoding is read-only.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The is single byte.</value>
|
/// <value>The is single byte.</value>
|
||||||
public bool IsReadOnly {
|
public override bool IsReadOnly {
|
||||||
get { return readOnly; }
|
get { return readOnly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSingleByte {
|
public override bool IsSingleByte {
|
||||||
get { return singleByte; }
|
get { return singleByte; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the code page identifier of the current Encoding.
|
/// Gets the code page identifier of the current Encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CodePage {
|
public override int CodePage {
|
||||||
get { return _codepage; }
|
get { return _codepage; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent body tags
|
/// Gets a name for the current encoding that can be used with mail agent body tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BodyName {
|
public override string BodyName {
|
||||||
get { return _bodyname; }
|
get { return _bodyname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent header tags
|
/// Gets a name for the current encoding that can be used with mail agent header tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string HeaderName {
|
public override string HeaderName {
|
||||||
get { return _headername; }
|
get { return _headername; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,14 +121,14 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the human-readable description of the current encoding.
|
/// Gets the human-readable description of the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string EncodingName {
|
public override string EncodingName {
|
||||||
get { return _encodingname; }
|
get { return _encodingname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int WindowsCodePage {
|
public override int WindowsCodePage {
|
||||||
get { return _windowsCodepage; }
|
get { return _windowsCodepage; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a ZX81 character encoding of Unicode characters.
|
/// Represents a ZX81 character encoding of Unicode characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ZX81 : System.Text.Encoding
|
public class ZX81 : Encoding
|
||||||
{
|
{
|
||||||
const string _bodyname = "zx81";
|
const string _bodyname = "zx81";
|
||||||
const int _codepage = 0;
|
const int _codepage = 0;
|
||||||
@@ -50,28 +50,28 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserDisplay {
|
public override bool IsBrowserDisplay {
|
||||||
get { return browserDisplay; }
|
get { return browserDisplay; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserSave {
|
public override bool IsBrowserSave {
|
||||||
get { return browserSave; }
|
get { return browserSave; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsDisplay {
|
public override bool IsMailNewsDisplay {
|
||||||
get { return mailNewsDisplay; }
|
get { return mailNewsDisplay; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsSave {
|
public override bool IsMailNewsSave {
|
||||||
get { return mailNewsSave; }
|
get { return mailNewsSave; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,35 +79,35 @@ namespace Claunia.Encoding
|
|||||||
/// Gets a value indicating whether the current encoding is read-only.
|
/// Gets a value indicating whether the current encoding is read-only.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The is single byte.</value>
|
/// <value>The is single byte.</value>
|
||||||
public bool IsReadOnly {
|
public override bool IsReadOnly {
|
||||||
get { return readOnly; }
|
get { return readOnly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSingleByte {
|
public override bool IsSingleByte {
|
||||||
get { return singleByte; }
|
get { return singleByte; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the code page identifier of the current Encoding.
|
/// Gets the code page identifier of the current Encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CodePage {
|
public override int CodePage {
|
||||||
get { return _codepage; }
|
get { return _codepage; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent body tags
|
/// Gets a name for the current encoding that can be used with mail agent body tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BodyName {
|
public override string BodyName {
|
||||||
get { return _bodyname; }
|
get { return _bodyname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent header tags
|
/// Gets a name for the current encoding that can be used with mail agent header tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string HeaderName {
|
public override string HeaderName {
|
||||||
get { return _headername; }
|
get { return _headername; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,14 +121,14 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the human-readable description of the current encoding.
|
/// Gets the human-readable description of the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string EncodingName {
|
public override string EncodingName {
|
||||||
get { return _encodingname; }
|
get { return _encodingname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int WindowsCodePage {
|
public override int WindowsCodePage {
|
||||||
get { return _windowsCodepage; }
|
get { return _windowsCodepage; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an ZX Spectrum character encoding of Unicode characters.
|
/// Represents an ZX Spectrum character encoding of Unicode characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ZXSpectrum : System.Text.Encoding
|
public class ZXSpectrum : Encoding
|
||||||
{
|
{
|
||||||
const string _bodyname = "spectrum";
|
const string _bodyname = "spectrum";
|
||||||
const int _codepage = 0;
|
const int _codepage = 0;
|
||||||
@@ -50,28 +50,28 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserDisplay {
|
public override bool IsBrowserDisplay {
|
||||||
get { return browserDisplay; }
|
get { return browserDisplay; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsBrowserSave {
|
public override bool IsBrowserSave {
|
||||||
get { return browserSave; }
|
get { return browserSave; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsDisplay {
|
public override bool IsMailNewsDisplay {
|
||||||
get { return mailNewsDisplay; }
|
get { return mailNewsDisplay; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMailNewsSave {
|
public override bool IsMailNewsSave {
|
||||||
get { return mailNewsSave; }
|
get { return mailNewsSave; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,35 +79,35 @@ namespace Claunia.Encoding
|
|||||||
/// Gets a value indicating whether the current encoding is read-only.
|
/// Gets a value indicating whether the current encoding is read-only.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The is single byte.</value>
|
/// <value>The is single byte.</value>
|
||||||
public bool IsReadOnly {
|
public override bool IsReadOnly {
|
||||||
get { return readOnly; }
|
get { return readOnly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
/// Gets a value indicating whether the current encoding uses single-byte code points.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSingleByte {
|
public override bool IsSingleByte {
|
||||||
get { return singleByte; }
|
get { return singleByte; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the code page identifier of the current Encoding.
|
/// Gets the code page identifier of the current Encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CodePage {
|
public override int CodePage {
|
||||||
get { return _codepage; }
|
get { return _codepage; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent body tags
|
/// Gets a name for the current encoding that can be used with mail agent body tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BodyName {
|
public override string BodyName {
|
||||||
get { return _bodyname; }
|
get { return _bodyname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a name for the current encoding that can be used with mail agent header tags
|
/// Gets a name for the current encoding that can be used with mail agent header tags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string HeaderName {
|
public override string HeaderName {
|
||||||
get { return _headername; }
|
get { return _headername; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,14 +121,14 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the human-readable description of the current encoding.
|
/// Gets the human-readable description of the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string EncodingName {
|
public override string EncodingName {
|
||||||
get { return _encodingname; }
|
get { return _encodingname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int WindowsCodePage {
|
public override int WindowsCodePage {
|
||||||
get { return _windowsCodepage; }
|
get { return _windowsCodepage; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user