mirror of
https://github.com/claunia/Claunia.Encoding.git
synced 2025-12-16 19:24:43 +00:00
Move to file-scoped namespaces.
This commit is contained in:
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Claunia.Encoding.Tests
|
namespace Claunia.Encoding.Tests;
|
||||||
|
|
||||||
|
[TestFixture]
|
||||||
|
public class Atascii
|
||||||
{
|
{
|
||||||
[TestFixture]
|
|
||||||
public class Atascii
|
|
||||||
{
|
|
||||||
const string PUNCTUATIONS = "!\"#$%&'()*+,-./:;<=>?@[\\]^_|";
|
const string PUNCTUATIONS = "!\"#$%&'()*+,-./:;<=>?@[\\]^_|";
|
||||||
readonly byte[] _punctuationsBytes =
|
readonly byte[] _punctuationsBytes =
|
||||||
{
|
{
|
||||||
@@ -126,5 +126,4 @@ namespace Claunia.Encoding.Tests
|
|||||||
byteArray = Encoding.AtariEncoding.GetBytes(DECKS);
|
byteArray = Encoding.AtariEncoding.GetBytes(DECKS);
|
||||||
Assert.AreEqual(_decksBytes, byteArray);
|
Assert.AreEqual(_decksBytes, byteArray);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Claunia.Encoding.Tests
|
namespace Claunia.Encoding.Tests;
|
||||||
|
|
||||||
|
[TestFixture]
|
||||||
|
public class AtariSt
|
||||||
{
|
{
|
||||||
[TestFixture]
|
|
||||||
public class AtariSt
|
|
||||||
{
|
|
||||||
const string PUNCTUATIONS = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
|
const string PUNCTUATIONS = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
|
||||||
readonly byte[] _punctuationsBytes =
|
readonly byte[] _punctuationsBytes =
|
||||||
{
|
{
|
||||||
@@ -257,5 +257,4 @@ namespace Claunia.Encoding.Tests
|
|||||||
/*byteArray = Encoding.AtariSTEncoding.GetBytes(SymbolsUnicode32);
|
/*byteArray = Encoding.AtariSTEncoding.GetBytes(SymbolsUnicode32);
|
||||||
Assert.AreEqual(SymbolsUnicode32Bytes, byteArray);*/
|
Assert.AreEqual(SymbolsUnicode32Bytes, byteArray);*/
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -27,11 +27,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Claunia.Encoding.Tests
|
namespace Claunia.Encoding.Tests;
|
||||||
|
|
||||||
|
[TestFixture]
|
||||||
|
public class GetEncs
|
||||||
{
|
{
|
||||||
[TestFixture]
|
|
||||||
public class GetEncs
|
|
||||||
{
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
||||||
// Well basically this is taken from MSDN's documentation :p
|
// Well basically this is taken from MSDN's documentation :p
|
||||||
@@ -70,5 +70,4 @@ namespace Claunia.Encoding.Tests
|
|||||||
{
|
{
|
||||||
System.Text.Encoding e = Encoding.GetEncoding("lisa");
|
System.Text.Encoding e = Encoding.GetEncoding("lisa");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Claunia.Encoding.Tests
|
namespace Claunia.Encoding.Tests;
|
||||||
|
|
||||||
|
[TestFixture]
|
||||||
|
public class LisaRoman
|
||||||
{
|
{
|
||||||
[TestFixture]
|
|
||||||
public class LisaRoman
|
|
||||||
{
|
|
||||||
const string PUNCTUATIONS = "!\"#$%&()*+,-./:;<=>?@[\\]^_{|}~";
|
const string PUNCTUATIONS = "!\"#$%&()*+,-./:;<=>?@[\\]^_{|}~";
|
||||||
readonly byte[] _punctuationsBytes =
|
readonly byte[] _punctuationsBytes =
|
||||||
{
|
{
|
||||||
@@ -212,5 +212,4 @@ namespace Claunia.Encoding.Tests
|
|||||||
byteArray = Encoding.LisaEncoding.GetBytes(MATHEMATICS);
|
byteArray = Encoding.LisaEncoding.GetBytes(MATHEMATICS);
|
||||||
Assert.AreEqual(_mathematicsBytes, byteArray);
|
Assert.AreEqual(_mathematicsBytes, byteArray);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Claunia.Encoding.Tests
|
namespace Claunia.Encoding.Tests;
|
||||||
|
|
||||||
|
[TestFixture]
|
||||||
|
public class Radix50
|
||||||
{
|
{
|
||||||
[TestFixture]
|
|
||||||
public class Radix50
|
|
||||||
{
|
|
||||||
const string PUNCTUATIONS = " .$%";
|
const string PUNCTUATIONS = " .$%";
|
||||||
readonly byte[] _punctuationsBytes =
|
readonly byte[] _punctuationsBytes =
|
||||||
{
|
{
|
||||||
@@ -85,5 +85,4 @@ namespace Claunia.Encoding.Tests
|
|||||||
byteArray = Encoding.Radix50Encoding.GetBytes(SENTENCE);
|
byteArray = Encoding.Radix50Encoding.GetBytes(SENTENCE);
|
||||||
Assert.AreEqual(_sentenceBytes, byteArray);
|
Assert.AreEqual(_sentenceBytes, byteArray);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an ATARI Standard Code for Information Interchange character encoding of Unicode characters.</summary>
|
||||||
|
public class ATASCII : SingleByteEncodingWithRunes
|
||||||
{
|
{
|
||||||
/// <summary>Represents an ATARI Standard Code for Information Interchange character encoding of Unicode characters.</summary>
|
|
||||||
public class ATASCII : SingleByteEncodingWithRunes
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "atascii";
|
public override string BodyName => "atascii";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -338,5 +338,4 @@ namespace Claunia.Encoding
|
|||||||
0x0007 => 0xFD,
|
0x0007 => 0xFD,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Apple II character encoding of Unicode characters.</summary>
|
||||||
|
public sealed class Apple2 : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Apple II character encoding of Unicode characters.</summary>
|
|
||||||
public sealed class Apple2 : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "apple2";
|
public override string BodyName => "apple2";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -226,5 +226,4 @@ namespace Claunia.Encoding
|
|||||||
'\u005F' => 0x5F,
|
'\u005F' => 0x5F,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Apple IIc character encoding of Unicode characters.</summary>
|
||||||
|
public sealed class Apple2c : SingleByteEncodingWithRunes
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Apple IIc character encoding of Unicode characters.</summary>
|
|
||||||
public sealed class Apple2c : SingleByteEncodingWithRunes
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "apple2c";
|
public override string BodyName => "apple2c";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -356,5 +356,4 @@ namespace Claunia.Encoding
|
|||||||
0x258F => 0xDF,
|
0x258F => 0xDF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Apple IIe character encoding of Unicode characters.</summary>
|
||||||
|
public class Apple2e : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Apple IIe character encoding of Unicode characters.</summary>
|
|
||||||
public class Apple2e : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "apple2e";
|
public override string BodyName => "apple2e";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -287,5 +287,4 @@ namespace Claunia.Encoding
|
|||||||
'\u007E' => 0x7E,
|
'\u007E' => 0x7E,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Apple IIgs character encoding of Unicode characters.</summary>
|
||||||
|
public class Apple2gs : SingleByteEncodingWithRunes
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Apple IIgs character encoding of Unicode characters.</summary>
|
|
||||||
public class Apple2gs : SingleByteEncodingWithRunes
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "apple2gs";
|
public override string BodyName => "apple2gs";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -323,5 +323,4 @@ namespace Claunia.Encoding
|
|||||||
0x007E => 0xFE,
|
0x007E => 0xFE,
|
||||||
_ => 0xBF
|
_ => 0xBF
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Atari ST character encoding of Unicode characters.</summary>
|
||||||
|
public class AtariST : SingleByteEncodingWithRunes
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Atari ST character encoding of Unicode characters.</summary>
|
|
||||||
public class AtariST : SingleByteEncodingWithRunes
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "atarist";
|
public override string BodyName => "atarist";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -447,5 +447,4 @@ namespace Claunia.Encoding
|
|||||||
0x00AF => 0xFF,
|
0x00AF => 0xFF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -29,11 +29,11 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>This class contains static instances of the supported encodings.</summary>
|
||||||
|
public abstract class Encoding : System.Text.Encoding
|
||||||
{
|
{
|
||||||
/// <summary>This class contains static instances of the supported encodings.</summary>
|
|
||||||
public abstract class Encoding : System.Text.Encoding
|
|
||||||
{
|
|
||||||
/// <summary>Static instance for the LisaRoman encoding</summary>
|
/// <summary>Static instance for the LisaRoman encoding</summary>
|
||||||
public static System.Text.Encoding LisaEncoding = new LisaRoman();
|
public static System.Text.Encoding LisaEncoding = new LisaRoman();
|
||||||
/// <summary>Static instance for the ATASCII encoding</summary>
|
/// <summary>Static instance for the ATASCII encoding</summary>
|
||||||
@@ -121,5 +121,4 @@ namespace Claunia.Encoding
|
|||||||
|
|
||||||
return System.Text.Encoding.GetEncoding(name);
|
return System.Text.Encoding.GetEncoding(name);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -4,11 +4,11 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Provides basic information about an encoding.</summary>
|
||||||
|
public sealed class EncodingInfo
|
||||||
{
|
{
|
||||||
/// <summary>Provides basic information about an encoding.</summary>
|
|
||||||
public sealed class EncodingInfo
|
|
||||||
{
|
|
||||||
readonly Type _thisType;
|
readonly Type _thisType;
|
||||||
bool _isSystem;
|
bool _isSystem;
|
||||||
|
|
||||||
@@ -54,5 +54,4 @@ namespace Claunia.Encoding
|
|||||||
/// <summary>Returns the hash code for the current EncodingInfo object.</summary>
|
/// <summary>Returns the hash code for the current EncodingInfo object.</summary>
|
||||||
/// <returns>A 32-bit signed integer hash code.</returns>
|
/// <returns>A 32-bit signed integer hash code.</returns>
|
||||||
public override int GetHashCode() => CodePage;
|
public override int GetHashCode() => CodePage;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents a GEM character encoding of Unicode characters.</summary>
|
||||||
|
public class GEM : SingleByteEncodingWithRunes
|
||||||
{
|
{
|
||||||
/// <summary>Represents a GEM character encoding of Unicode characters.</summary>
|
|
||||||
public class GEM : SingleByteEncodingWithRunes
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "gem";
|
public override string BodyName => "gem";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -444,5 +444,4 @@ namespace Claunia.Encoding
|
|||||||
0x2205 => 0xFF,
|
0x2205 => 0xFF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an GEOS character encoding of Unicode characters.</summary>
|
||||||
|
public class GEOS : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an GEOS character encoding of Unicode characters.</summary>
|
|
||||||
public class GEOS : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "geos";
|
public override string BodyName => "geos";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -405,5 +405,4 @@ namespace Claunia.Encoding
|
|||||||
'\u02D8' => 0xFD,
|
'\u02D8' => 0xFD,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Apple Lisa character encoding of Unicode characters.</summary>
|
||||||
|
public class LisaRoman : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Apple Lisa character encoding of Unicode characters.</summary>
|
|
||||||
public class LisaRoman : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "lisa";
|
public override string BodyName => "lisa";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -379,5 +379,4 @@ namespace Claunia.Encoding
|
|||||||
'\u00FF' => 0xD8,
|
'\u00FF' => 0xD8,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Mac Arabic character encoding of Unicode characters.</summary>
|
||||||
|
public class MacArabic : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Mac Arabic character encoding of Unicode characters.</summary>
|
|
||||||
public class MacArabic : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "x-mac-arabic";
|
public override string BodyName => "x-mac-arabic";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -395,5 +395,4 @@ namespace Claunia.Encoding
|
|||||||
'\u06D2' => 0xFF,
|
'\u06D2' => 0xFF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Mac CentralEuropean character encoding of Unicode characters.</summary>
|
||||||
|
public class MacCentralEuropean : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Mac CentralEuropean character encoding of Unicode characters.</summary>
|
|
||||||
public class MacCentralEuropean : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "x-mac-ce";
|
public override string BodyName => "x-mac-ce";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -421,5 +421,4 @@ namespace Claunia.Encoding
|
|||||||
'\u02C7' => 0xFF,
|
'\u02C7' => 0xFF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Mac Croatian character encoding of Unicode characters.</summary>
|
||||||
|
public class MacCroatian : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Mac Croatian character encoding of Unicode characters.</summary>
|
|
||||||
public class MacCroatian : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "x-mac-croatian";
|
public override string BodyName => "x-mac-croatian";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -420,5 +420,4 @@ namespace Claunia.Encoding
|
|||||||
'\u02C7' => 0xFF,
|
'\u02C7' => 0xFF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Mac Cyrillic character encoding of Unicode characters.</summary>
|
||||||
|
public class MacCyrillic : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Mac Cyrillic character encoding of Unicode characters.</summary>
|
|
||||||
public class MacCyrillic : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "x-mac-cyrillic";
|
public override string BodyName => "x-mac-cyrillic";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -421,5 +421,4 @@ namespace Claunia.Encoding
|
|||||||
'\u20AC' => 0xFF,
|
'\u20AC' => 0xFF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Mac Farsi character encoding of Unicode characters.</summary>
|
||||||
|
public class MacFarsi : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Mac Farsi character encoding of Unicode characters.</summary>
|
|
||||||
public class MacFarsi : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "x-mac-farsi";
|
public override string BodyName => "x-mac-farsi";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -395,5 +395,4 @@ namespace Claunia.Encoding
|
|||||||
'\u06D2' => 0xFF,
|
'\u06D2' => 0xFF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Mac Greek character encoding of Unicode characters.</summary>
|
||||||
|
public class MacGreek : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Mac Greek character encoding of Unicode characters.</summary>
|
|
||||||
public class MacGreek : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "x-mac-greek";
|
public override string BodyName => "x-mac-greek";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -421,5 +421,4 @@ namespace Claunia.Encoding
|
|||||||
'\u00AD' => 0xFF,
|
'\u00AD' => 0xFF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Mac Hebrew character encoding of Unicode characters.</summary>
|
||||||
|
public class MacHebrew : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Mac Hebrew character encoding of Unicode characters.</summary>
|
|
||||||
public class MacHebrew : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "x-mac-hebrew";
|
public override string BodyName => "x-mac-hebrew";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -386,5 +386,4 @@ namespace Claunia.Encoding
|
|||||||
'\u05EA' => 0xFA,
|
'\u05EA' => 0xFA,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Apple Mac character encoding of Unicode characters.</summary>
|
||||||
|
public class MacRoman : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Apple Mac character encoding of Unicode characters.</summary>
|
|
||||||
public class MacRoman : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "macintosh";
|
public override string BodyName => "macintosh";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -421,5 +421,4 @@ namespace Claunia.Encoding
|
|||||||
'\u02C7' => 0xFF,
|
'\u02C7' => 0xFF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Apple Mac character encoding of Unicode characters.</summary>
|
||||||
|
public class MacRomanian : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Apple Mac character encoding of Unicode characters.</summary>
|
|
||||||
public class MacRomanian : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "x-mac-romanian";
|
public override string BodyName => "x-mac-romanian";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -420,5 +420,4 @@ namespace Claunia.Encoding
|
|||||||
'\u02C7' => 0xFF,
|
'\u02C7' => 0xFF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Mac Turkish character encoding of Unicode characters.</summary>
|
||||||
|
public class MacTurkish : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Mac Turkish character encoding of Unicode characters.</summary>
|
|
||||||
public class MacTurkish : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "x-mac-turkish";
|
public override string BodyName => "x-mac-turkish";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -420,5 +420,4 @@ namespace Claunia.Encoding
|
|||||||
'\u02C7' => 0xFF,
|
'\u02C7' => 0xFF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Mac Ukrainian character encoding of Unicode characters.</summary>
|
||||||
|
public class MacUkrainian : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Mac Ukrainian character encoding of Unicode characters.</summary>
|
|
||||||
public class MacUkrainian : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "x-mac-ukrainian";
|
public override string BodyName => "x-mac-ukrainian";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -421,5 +421,4 @@ namespace Claunia.Encoding
|
|||||||
'\u20AC' => 0xFF,
|
'\u20AC' => 0xFF,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,14 +26,14 @@
|
|||||||
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
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 : SingleByteEncodingWithRunes
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Represents an Commodore PET Standard Code for Information Interchange (aka CBM ASCII) character encoding of
|
|
||||||
/// Unicode characters.
|
|
||||||
/// </summary>
|
|
||||||
public class PETSCII : SingleByteEncodingWithRunes
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "petscii";
|
public override string BodyName => "petscii";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -210,5 +210,4 @@ namespace Claunia.Encoding
|
|||||||
// Fallback to '?'
|
// Fallback to '?'
|
||||||
return 0x3F;
|
return 0x3F;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Class containing pangrams for several languages that can be used to test encoding.</summary>
|
||||||
|
public static class Pangrams
|
||||||
{
|
{
|
||||||
/// <summary>Class containing pangrams for several languages that can be used to test encoding.</summary>
|
|
||||||
public static class Pangrams
|
|
||||||
{
|
|
||||||
/// <summary>A pangram that contains all (or most) Arabic characters.</summary>
|
/// <summary>A pangram that contains all (or most) Arabic characters.</summary>
|
||||||
public const string ARABIC =
|
public const string ARABIC =
|
||||||
"صِف خَلقَ خَودِ كَمِثلِ الشَمسِ إِذ بَزَغَت — يَحظى الضَجيعُ بِها نَجلاءَ مِعطارِ";
|
"صِف خَلقَ خَودِ كَمِثلِ الشَمسِ إِذ بَزَغَت — يَحظى الضَجيعُ بِها نَجلاءَ مِعطارِ";
|
||||||
@@ -129,5 +129,4 @@ namespace Claunia.Encoding
|
|||||||
public const string TURKISH = "Pijamalı hasta yağız şoföre çabucak güvendi.";
|
public const string TURKISH = "Pijamalı hasta yağız şoföre çabucak güvendi.";
|
||||||
/// <summary>A pangram that contains all (or most) Welsh characters.</summary>
|
/// <summary>A pangram that contains all (or most) Welsh characters.</summary>
|
||||||
public const string WELSH = "Parciais fy jac codi baw hud llawn dŵr ger tŷ Mabon.";
|
public const string WELSH = "Parciais fy jac codi baw hud llawn dŵr ger tŷ Mabon.";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an Radix-50 (PDP-11) character encoding of Unicode characters.</summary>
|
||||||
|
public class Radix50 : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an Radix-50 (PDP-11) character encoding of Unicode characters.</summary>
|
|
||||||
public class Radix50 : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "radix50";
|
public override string BodyName => "radix50";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -345,5 +345,4 @@ namespace Claunia.Encoding
|
|||||||
'\u0039' => 0x27,
|
'\u0039' => 0x27,
|
||||||
_ => 0x1C
|
_ => 0x1C
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Implements a class that converts to/from a single byte codepage and UTF-16 representable strings
|
||||||
|
/// </summary>
|
||||||
|
public abstract class SingleByteEncoding : Encoding
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Implements a class that converts to/from a single byte codepage and UTF-16 representable strings
|
|
||||||
/// </summary>
|
|
||||||
public abstract class SingleByteEncoding : Encoding
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Character conversion table
|
/// Character conversion table
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -339,5 +339,4 @@ namespace Claunia.Encoding
|
|||||||
char GetChar(byte character) => CharTable[character];
|
char GetChar(byte character) => CharTable[character];
|
||||||
|
|
||||||
private protected abstract byte GetByte(char character);
|
private protected abstract byte GetByte(char character);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -3,14 +3,14 @@ using System.Globalization;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Implements a class that converts to/from a single byte codepage and strings that contains elements that need
|
||||||
|
/// surrogates in UTF-16, using runes.
|
||||||
|
/// </summary>
|
||||||
|
public abstract class SingleByteEncodingWithRunes : Encoding
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Implements a class that converts to/from a single byte codepage and strings that contains elements that need
|
|
||||||
/// surrogates in UTF-16, using runes.
|
|
||||||
/// </summary>
|
|
||||||
public abstract class SingleByteEncodingWithRunes : Encoding
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Rune conversion table
|
/// Rune conversion table
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -371,5 +371,4 @@ namespace Claunia.Encoding
|
|||||||
Rune GetChar(byte character) => CharTable[character];
|
Rune GetChar(byte character) => CharTable[character];
|
||||||
|
|
||||||
private protected abstract byte GetByte(Rune character);
|
private protected abstract byte GetByte(Rune character);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents a ZX80 character encoding of Unicode characters.</summary>
|
||||||
|
public class ZX80 : SingleByteEncodingWithRunes
|
||||||
{
|
{
|
||||||
/// <summary>Represents a ZX80 character encoding of Unicode characters.</summary>
|
|
||||||
public class ZX80 : SingleByteEncodingWithRunes
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "zx80";
|
public override string BodyName => "zx80";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -274,5 +274,4 @@ namespace Claunia.Encoding
|
|||||||
0x1FB92 => 0x8B,
|
0x1FB92 => 0x8B,
|
||||||
_ => 0x0F
|
_ => 0x0F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents a ZX81 character encoding of Unicode characters.</summary>
|
||||||
|
public class ZX81 : SingleByteEncodingWithRunes
|
||||||
{
|
{
|
||||||
/// <summary>Represents a ZX81 character encoding of Unicode characters.</summary>
|
|
||||||
public class ZX81 : SingleByteEncodingWithRunes
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "zx81";
|
public override string BodyName => "zx81";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -274,5 +274,4 @@ namespace Claunia.Encoding
|
|||||||
0x1FB92 => 0x8A,
|
0x1FB92 => 0x8A,
|
||||||
_ => 0x0F
|
_ => 0x0F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
namespace Claunia.Encoding
|
namespace Claunia.Encoding;
|
||||||
|
|
||||||
|
/// <summary>Represents an ZX Spectrum character encoding of Unicode characters.</summary>
|
||||||
|
public class ZXSpectrum : SingleByteEncoding
|
||||||
{
|
{
|
||||||
/// <summary>Represents an ZX Spectrum character encoding of Unicode characters.</summary>
|
|
||||||
public class ZXSpectrum : SingleByteEncoding
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string BodyName => "spectrum";
|
public override string BodyName => "spectrum";
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -275,5 +275,4 @@ namespace Claunia.Encoding
|
|||||||
'\u2588' => 0x8F,
|
'\u2588' => 0x8F,
|
||||||
_ => 0x3F
|
_ => 0x3F
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user