Added code to get a list of available encodings.

This commit is contained in:
2017-10-12 21:11:04 +01:00
parent d873345124
commit 1bef17c7a0
12 changed files with 319 additions and 93 deletions

View File

@@ -37,6 +37,7 @@
<Compile Include="LisaRoman.cs" />
<Compile Include="ATASCII.cs" />
<Compile Include="AtariST.cs" />
<Compile Include="GetEncs.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

View 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);
}
}
}
}

View File

@@ -31,7 +31,7 @@ namespace Claunia.Encoding
/// <summary>
/// Represents an ATARI Standard Code for Information Interchange character encoding of Unicode characters.
/// </summary>
public class ATASCII : System.Text.Encoding
public class ATASCII : Encoding
{
const string _bodyname = "atascii";
const int _codepage = 0;
@@ -50,28 +50,28 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
/// </summary>
public bool IsBrowserDisplay {
public override bool IsBrowserDisplay {
get { return browserDisplay; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
/// </summary>
public bool IsBrowserSave {
public override bool IsBrowserSave {
get { return browserSave; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
/// </summary>
public bool IsMailNewsDisplay {
public override bool IsMailNewsDisplay {
get { return mailNewsDisplay; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
/// </summary>
public bool IsMailNewsSave {
public override bool IsMailNewsSave {
get { return mailNewsSave; }
}
@@ -79,35 +79,35 @@ namespace Claunia.Encoding
/// Gets a value indicating whether the current encoding is read-only.
/// </summary>
/// <value>The is single byte.</value>
public bool IsReadOnly {
public override bool IsReadOnly {
get { return readOnly; }
}
/// <summary>
/// Gets a value indicating whether the current encoding uses single-byte code points.
/// </summary>
public bool IsSingleByte {
public override bool IsSingleByte {
get { return singleByte; }
}
/// <summary>
/// Gets the code page identifier of the current Encoding.
/// </summary>
public int CodePage {
public override int CodePage {
get { return _codepage; }
}
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent body tags
/// </summary>
public string BodyName {
public override string BodyName {
get { return _bodyname; }
}
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent header tags
/// </summary>
public string HeaderName {
public override string HeaderName {
get { return _headername; }
}
@@ -121,14 +121,14 @@ namespace Claunia.Encoding
/// <summary>
/// Gets the human-readable description of the current encoding.
/// </summary>
public string EncodingName {
public override string EncodingName {
get { return _encodingname; }
}
/// <summary>
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
/// </summary>
public int WindowsCodePage {
public override int WindowsCodePage {
get { return _windowsCodepage; }
}

View File

@@ -32,7 +32,7 @@ namespace Claunia.Encoding
/// Represents an Atari ST character encoding of Unicode characters.
/// </summary>
// TODO: 0x09 => U+1F552, 0x0A => U+1F514
public class AtariST : System.Text.Encoding
public class AtariST : Encoding
{
const string _bodyname = "atarist";
const int _codepage = 0;
@@ -51,28 +51,28 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
/// </summary>
public bool IsBrowserDisplay {
public override bool IsBrowserDisplay {
get { return browserDisplay; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
/// </summary>
public bool IsBrowserSave {
public override bool IsBrowserSave {
get { return browserSave; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
/// </summary>
public bool IsMailNewsDisplay {
public override bool IsMailNewsDisplay {
get { return mailNewsDisplay; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
/// </summary>
public bool IsMailNewsSave {
public override bool IsMailNewsSave {
get { return mailNewsSave; }
}
@@ -80,35 +80,35 @@ namespace Claunia.Encoding
/// Gets a value indicating whether the current encoding is read-only.
/// </summary>
/// <value>The is single byte.</value>
public bool IsReadOnly {
public override bool IsReadOnly {
get { return readOnly; }
}
/// <summary>
/// Gets a value indicating whether the current encoding uses single-byte code points.
/// </summary>
public bool IsSingleByte {
public override bool IsSingleByte {
get { return singleByte; }
}
/// <summary>
/// Gets the code page identifier of the current Encoding.
/// </summary>
public int CodePage {
public override int CodePage {
get { return _codepage; }
}
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent body tags
/// </summary>
public string BodyName {
public override string BodyName {
get { return _bodyname; }
}
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent header tags
/// </summary>
public string HeaderName {
public override string HeaderName {
get { return _headername; }
}
@@ -122,14 +122,14 @@ namespace Claunia.Encoding
/// <summary>
/// Gets the human-readable description of the current encoding.
/// </summary>
public string EncodingName {
public override string EncodingName {
get { return _encodingname; }
}
/// <summary>
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
/// </summary>
public int WindowsCodePage {
public override int WindowsCodePage {
get { return _windowsCodepage; }
}

View File

@@ -54,6 +54,7 @@
<Compile Include="ZX80.cs" />
<Compile Include="ZX81.cs" />
<Compile Include="ZXSpectrum.cs" />
<Compile Include="EncodingInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\LICENSE.MIT">
@@ -73,14 +74,8 @@
<MonoDevelop>
<Properties>
<Policies>
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-csharp">
<inheritsSet />
<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>
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-csharp" />
<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" />
</Policies>
</Properties>
</MonoDevelop>

View File

@@ -24,12 +24,16 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Reflection;
namespace Claunia.Encoding
{
/// <summary>
/// This class contains static instances of the supported encodings.
/// </summary>
public static class Encoding
public abstract class Encoding : System.Text.Encoding
{
/// <summary>
/// Static instance for the LisaRoman encoding
@@ -47,6 +51,85 @@ namespace Claunia.Encoding
/// Static instance for the PETSCII encoding
/// </summary>
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; }
}
}

View 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;
}
}
}

View File

@@ -31,7 +31,7 @@ namespace Claunia.Encoding
/// <summary>
/// Represents an Apple Lisa character encoding of Unicode characters.
/// </summary>
public class LisaRoman : System.Text.Encoding
public class LisaRoman : Encoding
{
const string _bodyname = "lisa";
const int _codepage = 0;
@@ -50,28 +50,28 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
/// </summary>
public bool IsBrowserDisplay {
public override bool IsBrowserDisplay {
get { return browserDisplay; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
/// </summary>
public bool IsBrowserSave {
public override bool IsBrowserSave {
get { return browserSave; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
/// </summary>
public bool IsMailNewsDisplay {
public override bool IsMailNewsDisplay {
get { return mailNewsDisplay; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
/// </summary>
public bool IsMailNewsSave {
public override bool IsMailNewsSave {
get { return mailNewsSave; }
}
@@ -79,35 +79,35 @@ namespace Claunia.Encoding
/// Gets a value indicating whether the current encoding is read-only.
/// </summary>
/// <value>The is single byte.</value>
public bool IsReadOnly {
public override bool IsReadOnly {
get { return readOnly; }
}
/// <summary>
/// Gets a value indicating whether the current encoding uses single-byte code points.
/// </summary>
public bool IsSingleByte {
public override bool IsSingleByte {
get { return singleByte; }
}
/// <summary>
/// Gets the code page identifier of the current Encoding.
/// </summary>
public int CodePage {
public override int CodePage {
get { return _codepage; }
}
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent body tags
/// </summary>
public string BodyName {
public override string BodyName {
get { return _bodyname; }
}
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent header tags
/// </summary>
public string HeaderName {
public override string HeaderName {
get { return _headername; }
}
@@ -121,14 +121,14 @@ namespace Claunia.Encoding
/// <summary>
/// Gets the human-readable description of the current encoding.
/// </summary>
public string EncodingName {
public override string EncodingName {
get { return _encodingname; }
}
/// <summary>
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
/// </summary>
public int WindowsCodePage {
public override int WindowsCodePage {
get { return _windowsCodepage; }
}

View File

@@ -31,7 +31,7 @@ namespace Claunia.Encoding
/// <summary>
/// Represents an Commodore PET Standard Code for Information Interchange (aka CBM ASCII) character encoding of Unicode characters.
/// </summary>
public class PETSCII : System.Text.Encoding
public class PETSCII : Encoding
{
const string _bodyname = "petscii";
const int _codepage = 0;
@@ -50,7 +50,7 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
/// </summary>
public bool IsBrowserDisplay
public override bool IsBrowserDisplay
{
get { return browserDisplay; }
}
@@ -58,7 +58,7 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
/// </summary>
public bool IsBrowserSave
public override bool IsBrowserSave
{
get { return browserSave; }
}
@@ -66,7 +66,7 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
/// </summary>
public bool IsMailNewsDisplay
public override bool IsMailNewsDisplay
{
get { return mailNewsDisplay; }
}
@@ -74,7 +74,7 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
/// </summary>
public bool IsMailNewsSave
public override bool IsMailNewsSave
{
get { return mailNewsSave; }
}
@@ -82,7 +82,7 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a value indicating whether the current encoding is read-only.
/// </summary>
public bool IsReadOnly
public override bool IsReadOnly
{
get { return readOnly; }
}
@@ -90,7 +90,7 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a value indicating whether the current encoding uses single-byte code points.
/// </summary>
public bool IsSingleByte
public override bool IsSingleByte
{
get { return singleByte; }
}
@@ -98,7 +98,7 @@ namespace Claunia.Encoding
/// <summary>
/// Gets the code page identifier of the current Encoding.
/// </summary>
public int CodePage
public override int CodePage
{
get { return _codepage; }
}
@@ -106,7 +106,7 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent body tags
/// </summary>
public string BodyName
public override string BodyName
{
get { return _bodyname; }
}
@@ -114,7 +114,7 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent header tags
/// </summary>
public string HeaderName
public override string HeaderName
{
get { return _headername; }
}
@@ -130,7 +130,7 @@ namespace Claunia.Encoding
/// <summary>
/// Gets the human-readable description of the current encoding.
/// </summary>
public string EncodingName
public override string EncodingName
{
get { return _encodingname; }
}
@@ -138,7 +138,7 @@ namespace Claunia.Encoding
/// <summary>
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
/// </summary>
public int WindowsCodePage
public override int WindowsCodePage
{
get { return _windowsCodepage; }
}

View File

@@ -31,7 +31,7 @@ namespace Claunia.Encoding
/// <summary>
/// Represents a ZX80 character encoding of Unicode characters.
/// </summary>
public class ZX80 : System.Text.Encoding
public class ZX80 : Encoding
{
const string _bodyname = "zx80";
const int _codepage = 0;
@@ -50,28 +50,28 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
/// </summary>
public bool IsBrowserDisplay {
public override bool IsBrowserDisplay {
get { return browserDisplay; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
/// </summary>
public bool IsBrowserSave {
public override bool IsBrowserSave {
get { return browserSave; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
/// </summary>
public bool IsMailNewsDisplay {
public override bool IsMailNewsDisplay {
get { return mailNewsDisplay; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
/// </summary>
public bool IsMailNewsSave {
public override bool IsMailNewsSave {
get { return mailNewsSave; }
}
@@ -79,35 +79,35 @@ namespace Claunia.Encoding
/// Gets a value indicating whether the current encoding is read-only.
/// </summary>
/// <value>The is single byte.</value>
public bool IsReadOnly {
public override bool IsReadOnly {
get { return readOnly; }
}
/// <summary>
/// Gets a value indicating whether the current encoding uses single-byte code points.
/// </summary>
public bool IsSingleByte {
public override bool IsSingleByte {
get { return singleByte; }
}
/// <summary>
/// Gets the code page identifier of the current Encoding.
/// </summary>
public int CodePage {
public override int CodePage {
get { return _codepage; }
}
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent body tags
/// </summary>
public string BodyName {
public override string BodyName {
get { return _bodyname; }
}
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent header tags
/// </summary>
public string HeaderName {
public override string HeaderName {
get { return _headername; }
}
@@ -121,14 +121,14 @@ namespace Claunia.Encoding
/// <summary>
/// Gets the human-readable description of the current encoding.
/// </summary>
public string EncodingName {
public override string EncodingName {
get { return _encodingname; }
}
/// <summary>
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
/// </summary>
public int WindowsCodePage {
public override int WindowsCodePage {
get { return _windowsCodepage; }
}

View File

@@ -31,7 +31,7 @@ namespace Claunia.Encoding
/// <summary>
/// Represents a ZX81 character encoding of Unicode characters.
/// </summary>
public class ZX81 : System.Text.Encoding
public class ZX81 : Encoding
{
const string _bodyname = "zx81";
const int _codepage = 0;
@@ -50,28 +50,28 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
/// </summary>
public bool IsBrowserDisplay {
public override bool IsBrowserDisplay {
get { return browserDisplay; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
/// </summary>
public bool IsBrowserSave {
public override bool IsBrowserSave {
get { return browserSave; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
/// </summary>
public bool IsMailNewsDisplay {
public override bool IsMailNewsDisplay {
get { return mailNewsDisplay; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
/// </summary>
public bool IsMailNewsSave {
public override bool IsMailNewsSave {
get { return mailNewsSave; }
}
@@ -79,35 +79,35 @@ namespace Claunia.Encoding
/// Gets a value indicating whether the current encoding is read-only.
/// </summary>
/// <value>The is single byte.</value>
public bool IsReadOnly {
public override bool IsReadOnly {
get { return readOnly; }
}
/// <summary>
/// Gets a value indicating whether the current encoding uses single-byte code points.
/// </summary>
public bool IsSingleByte {
public override bool IsSingleByte {
get { return singleByte; }
}
/// <summary>
/// Gets the code page identifier of the current Encoding.
/// </summary>
public int CodePage {
public override int CodePage {
get { return _codepage; }
}
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent body tags
/// </summary>
public string BodyName {
public override string BodyName {
get { return _bodyname; }
}
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent header tags
/// </summary>
public string HeaderName {
public override string HeaderName {
get { return _headername; }
}
@@ -121,14 +121,14 @@ namespace Claunia.Encoding
/// <summary>
/// Gets the human-readable description of the current encoding.
/// </summary>
public string EncodingName {
public override string EncodingName {
get { return _encodingname; }
}
/// <summary>
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
/// </summary>
public int WindowsCodePage {
public override int WindowsCodePage {
get { return _windowsCodepage; }
}

View File

@@ -31,7 +31,7 @@ namespace Claunia.Encoding
/// <summary>
/// Represents an ZX Spectrum character encoding of Unicode characters.
/// </summary>
public class ZXSpectrum : System.Text.Encoding
public class ZXSpectrum : Encoding
{
const string _bodyname = "spectrum";
const int _codepage = 0;
@@ -50,28 +50,28 @@ namespace Claunia.Encoding
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for displaying content.
/// </summary>
public bool IsBrowserDisplay {
public override bool IsBrowserDisplay {
get { return browserDisplay; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by browser clients for saving content.
/// </summary>
public bool IsBrowserSave {
public override bool IsBrowserSave {
get { return browserSave; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for displaying content.
/// </summary>
public bool IsMailNewsDisplay {
public override bool IsMailNewsDisplay {
get { return mailNewsDisplay; }
}
/// <summary>
/// Gets a value indicating whether the current encoding can be used by mail and news clients for saving content.
/// </summary>
public bool IsMailNewsSave {
public override bool IsMailNewsSave {
get { return mailNewsSave; }
}
@@ -79,35 +79,35 @@ namespace Claunia.Encoding
/// Gets a value indicating whether the current encoding is read-only.
/// </summary>
/// <value>The is single byte.</value>
public bool IsReadOnly {
public override bool IsReadOnly {
get { return readOnly; }
}
/// <summary>
/// Gets a value indicating whether the current encoding uses single-byte code points.
/// </summary>
public bool IsSingleByte {
public override bool IsSingleByte {
get { return singleByte; }
}
/// <summary>
/// Gets the code page identifier of the current Encoding.
/// </summary>
public int CodePage {
public override int CodePage {
get { return _codepage; }
}
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent body tags
/// </summary>
public string BodyName {
public override string BodyName {
get { return _bodyname; }
}
/// <summary>
/// Gets a name for the current encoding that can be used with mail agent header tags
/// </summary>
public string HeaderName {
public override string HeaderName {
get { return _headername; }
}
@@ -121,14 +121,14 @@ namespace Claunia.Encoding
/// <summary>
/// Gets the human-readable description of the current encoding.
/// </summary>
public string EncodingName {
public override string EncodingName {
get { return _encodingname; }
}
/// <summary>
/// Gets the Windows operating system code page that most closely corresponds to the current encoding.
/// </summary>
public int WindowsCodePage {
public override int WindowsCodePage {
get { return _windowsCodepage; }
}