mirror of
https://github.com/claunia/Claunia.Encoding.git
synced 2026-07-09 02:16:28 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
240f586614
|
|||
|
ffa321c760
|
|||
|
8ff97425f9
|
|||
|
ffba6dbf05
|
|||
|
7e430d1a57
|
|||
|
27cb171968
|
|||
|
3b05c4f61f
|
|||
|
c63f2cf81e
|
|||
|
b91633a631
|
|||
|
2da99e07d6
|
|||
|
38eee129d1
|
|||
|
1ea66e73c6
|
16
.idea/.idea.Claunia.Encoding/.idea/csv-plugin.xml
generated
Normal file
16
.idea/.idea.Claunia.Encoding/.idea/csv-plugin.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CsvFileAttributes">
|
||||
<option name="attributeMap">
|
||||
<map>
|
||||
<entry key="/Claunia.Encoding/Gem.cs">
|
||||
<value>
|
||||
<Attribute>
|
||||
<option name="separator" value="," />
|
||||
</Attribute>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -61,7 +61,7 @@ namespace Claunia.Encoding.Tests
|
||||
0x01, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0E, 0x0F, 0x11, 0x12, 0x13, 0x14, 0x15,
|
||||
0x16, 0x17, 0x18, 0x19, 0x1A
|
||||
};
|
||||
const string ARROWS = "↑↓←→↰◀▶";
|
||||
const string ARROWS = "↑↓←→🢰◀▶";
|
||||
readonly byte[] _arrowsBytes =
|
||||
{
|
||||
0x1C, 0x1D, 0x1E, 0x1F, 0x7D, 0x7E, 0x7F
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Claunia.Encoding.Tests
|
||||
0xA9, 0xAA, 0xAB, 0xAC, 0xDE, 0xDF, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
|
||||
0xFB, 0xFC, 0xFD, 0xFE
|
||||
};
|
||||
const string SYMBOLS = "⇧⇩⇨⇦❎✓♪ə";
|
||||
const string SYMBOLS = "⇧⇩⇨⇦🮽✓♪ə";
|
||||
readonly byte[] _symbolsBytes =
|
||||
{
|
||||
0x01, 0x02, 0x03, 0x04, 0x05, 0x08, 0x0B, 0x1A
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<RootNamespace>Claunia.Encoding.Tests</RootNamespace>
|
||||
<AssemblyName>Claunia.Encoding.Tests</AssemblyName>
|
||||
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<ReleaseVersion>1.8</ReleaseVersion>
|
||||
<ReleaseVersion>1.9</ReleaseVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Claunia.Encoding\Claunia.Encoding.csproj">
|
||||
|
||||
@@ -24,264 +24,319 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace Claunia.Encoding
|
||||
{
|
||||
/// <summary>Represents an ATARI Standard Code for Information Interchange character encoding of Unicode characters.</summary>
|
||||
public class Atascii : SingleByteEncoding
|
||||
public class Atascii : SingleByteEncodingWithRunes
|
||||
{
|
||||
public override string BodyName => "atascii";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Atari Standard Code for Information Interchange";
|
||||
public override string HeaderName => "atascii";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "atascii";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Atari Standard Code for Information Interchange";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "atascii";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => false;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The ATASCII to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
protected override Rune[] CharTable => new[]
|
||||
{
|
||||
// 0x00
|
||||
'\u2665', '\u251C', '\uFFFD', '\u2518', '\u2524', '\u2510', '\u2571', '\u2572',
|
||||
new Rune(0x2665), new Rune(0x251C), new Rune(0x1FB87), new Rune(0x2518), new Rune(0x2524), new Rune(0x2510),
|
||||
new Rune(0x2571), new Rune(0x2572),
|
||||
|
||||
// 0x08
|
||||
'\u25E2', '\u2597', '\u25E3', '\u259D', '\u2598', '\uFFFD', '\u2582', '\u2596',
|
||||
new Rune(0x25E2), new Rune(0x2597), new Rune(0x25E3), new Rune(0x259D), new Rune(0x2598), new Rune(0x1FB82),
|
||||
new Rune(0x2582), new Rune(0x2596),
|
||||
|
||||
// 0x10
|
||||
'\u2663', '\u250C', '\u2500', '\u253C', '\u25CF', '\u2584', '\u258E', '\u252C',
|
||||
new Rune(0x2663), new Rune(0x250C), new Rune(0x2500), new Rune(0x253C), new Rune(0x25CF), new Rune(0x2584),
|
||||
new Rune(0x258E), new Rune(0x252C),
|
||||
|
||||
// 0x18
|
||||
'\u2534', '\u258C', '\u2514', '\u001B', '\u2191', '\u2193', '\u2190', '\u2192',
|
||||
new Rune(0x2534), new Rune(0x258C), new Rune(0x2514), new Rune(0x001B), new Rune(0x2191), new Rune(0x2193),
|
||||
new Rune(0x2190), new Rune(0x2192),
|
||||
|
||||
// 0x20
|
||||
'\u0020', '\u0021', '\u0022', '\u0023', '\u0024', '\u0025', '\u0026', '\u0027',
|
||||
new Rune(0x0020), new Rune(0x0021), new Rune(0x0022), new Rune(0x0023), new Rune(0x0024), new Rune(0x0025),
|
||||
new Rune(0x0026), new Rune(0x0027),
|
||||
|
||||
// 0x28
|
||||
'\u0028', '\u0029', '\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F',
|
||||
new Rune(0x0028), new Rune(0x0029), new Rune(0x002A), new Rune(0x002B), new Rune(0x002C), new Rune(0x002D),
|
||||
new Rune(0x002E), new Rune(0x002F),
|
||||
|
||||
// 0x30
|
||||
'\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037',
|
||||
new Rune(0x0030), new Rune(0x0031), new Rune(0x0032), new Rune(0x0033), new Rune(0x0034), new Rune(0x0035),
|
||||
new Rune(0x0036), new Rune(0x0037),
|
||||
|
||||
// 0x38
|
||||
'\u0038', '\u0039', '\u003A', '\u003B', '\u003C', '\u003D', '\u003E', '\u003F',
|
||||
new Rune(0x0038), new Rune(0x0039), new Rune(0x003A), new Rune(0x003B), new Rune(0x003C), new Rune(0x003D),
|
||||
new Rune(0x003E), new Rune(0x003F),
|
||||
|
||||
// 0x40
|
||||
'\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047',
|
||||
new Rune(0x0040), new Rune(0x0041), new Rune(0x0042), new Rune(0x0043), new Rune(0x0044), new Rune(0x0045),
|
||||
new Rune(0x0046), new Rune(0x0047),
|
||||
|
||||
// 0x48
|
||||
'\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D', '\u004E', '\u004F',
|
||||
new Rune(0x0048), new Rune(0x0049), new Rune(0x004A), new Rune(0x004B), new Rune(0x004C), new Rune(0x004D),
|
||||
new Rune(0x004E), new Rune(0x004F),
|
||||
|
||||
// 0x50
|
||||
'\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057',
|
||||
new Rune(0x0050), new Rune(0x0051), new Rune(0x0052), new Rune(0x0053), new Rune(0x0054), new Rune(0x0055),
|
||||
new Rune(0x0056), new Rune(0x0057),
|
||||
|
||||
// 0x58
|
||||
'\u0058', '\u0059', '\u005A', '\u005B', '\u005C', '\u005D', '\u005E', '\u005F',
|
||||
new Rune(0x0058), new Rune(0x0059), new Rune(0x005A), new Rune(0x005B), new Rune(0x005C), new Rune(0x005D),
|
||||
new Rune(0x005E), new Rune(0x005F),
|
||||
|
||||
// 0x60
|
||||
'\u2666', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065', '\u0066', '\u0067',
|
||||
new Rune(0x2666), new Rune(0x0061), new Rune(0x0062), new Rune(0x0063), new Rune(0x0064), new Rune(0x0065),
|
||||
new Rune(0x0066), new Rune(0x0067),
|
||||
|
||||
// 0x68
|
||||
'\u0068', '\u0069', '\u006A', '\u006B', '\u006C', '\u006D', '\u006E', '\u006F',
|
||||
new Rune(0x0068), new Rune(0x0069), new Rune(0x006A), new Rune(0x006B), new Rune(0x006C), new Rune(0x006D),
|
||||
new Rune(0x006E), new Rune(0x006F),
|
||||
|
||||
// 0x70
|
||||
'\u0070', '\u0071', '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077',
|
||||
new Rune(0x0070), new Rune(0x0071), new Rune(0x0072), new Rune(0x0073), new Rune(0x0074), new Rune(0x0075),
|
||||
new Rune(0x0076), new Rune(0x0077),
|
||||
|
||||
// 0x78
|
||||
'\u0078', '\u0079', '\u007A', '\u2660', '\u007C', '\u21B0', '\u25C0', '\u25B6',
|
||||
new Rune(0x0078), new Rune(0x0079), new Rune(0x007A), new Rune(0x2660), new Rune(0x007C), new Rune(0x1F8B0),
|
||||
new Rune(0x25C0), new Rune(0x25B6),
|
||||
|
||||
// 0x80
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x258A), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x88
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x25E4), new Rune(0x259B), new Rune(0x25E5), new Rune(0x2599), new Rune(0x259F), new Rune(0x2586),
|
||||
new Rune(0x0000), new Rune(0x259C),
|
||||
|
||||
// 0x90
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x25D8), new Rune(0x2580),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x98
|
||||
'\u0000', '\u0000', '\u0000', '\u000D', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x2590), new Rune(0x0000), new Rune(0x000D), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xA0
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x2588), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xA8
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xB0
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xB8
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xC0
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xC8
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xD0
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xD8
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xE0
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xE8
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xF0
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xF8
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0007', '\u0000', '\u0000'
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0007),
|
||||
new Rune(0x0000), new Rune(0x0000)
|
||||
};
|
||||
|
||||
/// <summary>Converts a Unicode character to an ATASCII character</summary>
|
||||
/// <returns>ATASCII character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(Rune character) => character.Value switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u2665': return 0x00;
|
||||
case '\u251C': return 0x01;
|
||||
case '\u2518': return 0x03;
|
||||
case '\u2524': return 0x04;
|
||||
case '\u2510': return 0x05;
|
||||
case '\u2571': return 0x06;
|
||||
case '\u2572': return 0x07;
|
||||
case '\u25E2': return 0x08;
|
||||
case '\u2597': return 0x09;
|
||||
case '\u25E3': return 0x0A;
|
||||
case '\u259D': return 0x0B;
|
||||
case '\u2598': return 0x0C;
|
||||
case '\u2582': return 0x0E;
|
||||
case '\u2596': return 0x0F;
|
||||
case '\u2663': return 0x10;
|
||||
case '\u250C': return 0x11;
|
||||
case '\u2500': return 0x12;
|
||||
case '\u253C': return 0x13;
|
||||
case '\u25CF': return 0x14;
|
||||
case '\u2584': return 0x15;
|
||||
case '\u258E': return 0x16;
|
||||
case '\u252C': return 0x17;
|
||||
case '\u2534': return 0x18;
|
||||
case '\u258C': return 0x19;
|
||||
case '\u2514': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u2191': return 0x1C;
|
||||
case '\u2193': return 0x1D;
|
||||
case '\u2190': return 0x1E;
|
||||
case '\u2192': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u2666': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u2660': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u21B0': return 0x7D;
|
||||
case '\u25C0': return 0x7E;
|
||||
case '\u25B6': return 0x7F;
|
||||
case '\u000D': return 0x9B;
|
||||
case '\u0007': return 0xFD;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
0x2665 => 0x00,
|
||||
0x251C => 0x01,
|
||||
0x1FB87 => 0x02,
|
||||
0x2518 => 0x03,
|
||||
0x2524 => 0x04,
|
||||
0x2510 => 0x05,
|
||||
0x2571 => 0x06,
|
||||
0x2572 => 0x07,
|
||||
0x25E2 => 0x08,
|
||||
0x2597 => 0x09,
|
||||
0x25E3 => 0x0A,
|
||||
0x259D => 0x0B,
|
||||
0x2598 => 0x0C,
|
||||
0x1FB82 => 0x0D,
|
||||
0x2582 => 0x0E,
|
||||
0x2596 => 0x0F,
|
||||
0x2663 => 0x10,
|
||||
0x250C => 0x11,
|
||||
0x2500 => 0x12,
|
||||
0x253C => 0x13,
|
||||
0x25CF => 0x14,
|
||||
0x2584 => 0x15,
|
||||
0x258E => 0x16,
|
||||
0x252C => 0x17,
|
||||
0x2534 => 0x18,
|
||||
0x258C => 0x19,
|
||||
0x2514 => 0x1A,
|
||||
0x001B => 0x1B,
|
||||
0x2191 => 0x1C,
|
||||
0x2193 => 0x1D,
|
||||
0x2190 => 0x1E,
|
||||
0x2192 => 0x1F,
|
||||
0x0020 => 0x20,
|
||||
0x0021 => 0x21,
|
||||
0x0022 => 0x22,
|
||||
0x0023 => 0x23,
|
||||
0x0024 => 0x24,
|
||||
0x0025 => 0x25,
|
||||
0x0026 => 0x26,
|
||||
0x0027 => 0x27,
|
||||
0x0028 => 0x28,
|
||||
0x0029 => 0x29,
|
||||
0x002A => 0x2A,
|
||||
0x002B => 0x2B,
|
||||
0x002C => 0x2C,
|
||||
0x002D => 0x2D,
|
||||
0x002E => 0x2E,
|
||||
0x002F => 0x2F,
|
||||
0x0030 => 0x30,
|
||||
0x0031 => 0x31,
|
||||
0x0032 => 0x32,
|
||||
0x0033 => 0x33,
|
||||
0x0034 => 0x34,
|
||||
0x0035 => 0x35,
|
||||
0x0036 => 0x36,
|
||||
0x0037 => 0x37,
|
||||
0x0038 => 0x38,
|
||||
0x0039 => 0x39,
|
||||
0x003A => 0x3A,
|
||||
0x003B => 0x3B,
|
||||
0x003C => 0x3C,
|
||||
0x003D => 0x3D,
|
||||
0x003E => 0x3E,
|
||||
0x003F => 0x3F,
|
||||
0x0040 => 0x40,
|
||||
0x0041 => 0x41,
|
||||
0x0042 => 0x42,
|
||||
0x0043 => 0x43,
|
||||
0x0044 => 0x44,
|
||||
0x0045 => 0x45,
|
||||
0x0046 => 0x46,
|
||||
0x0047 => 0x47,
|
||||
0x0048 => 0x48,
|
||||
0x0049 => 0x49,
|
||||
0x004A => 0x4A,
|
||||
0x004B => 0x4B,
|
||||
0x004C => 0x4C,
|
||||
0x004D => 0x4D,
|
||||
0x004E => 0x4E,
|
||||
0x004F => 0x4F,
|
||||
0x0050 => 0x50,
|
||||
0x0051 => 0x51,
|
||||
0x0052 => 0x52,
|
||||
0x0053 => 0x53,
|
||||
0x0054 => 0x54,
|
||||
0x0055 => 0x55,
|
||||
0x0056 => 0x56,
|
||||
0x0057 => 0x57,
|
||||
0x0058 => 0x58,
|
||||
0x0059 => 0x59,
|
||||
0x005A => 0x5A,
|
||||
0x005B => 0x5B,
|
||||
0x005C => 0x5C,
|
||||
0x005D => 0x5D,
|
||||
0x005E => 0x5E,
|
||||
0x005F => 0x5F,
|
||||
0x2666 => 0x60,
|
||||
0x0061 => 0x61,
|
||||
0x0062 => 0x62,
|
||||
0x0063 => 0x63,
|
||||
0x0064 => 0x64,
|
||||
0x0065 => 0x65,
|
||||
0x0066 => 0x66,
|
||||
0x0067 => 0x67,
|
||||
0x0068 => 0x68,
|
||||
0x0069 => 0x69,
|
||||
0x006A => 0x6A,
|
||||
0x006B => 0x6B,
|
||||
0x006C => 0x6C,
|
||||
0x006D => 0x6D,
|
||||
0x006E => 0x6E,
|
||||
0x006F => 0x6F,
|
||||
0x0070 => 0x70,
|
||||
0x0071 => 0x71,
|
||||
0x0072 => 0x72,
|
||||
0x0073 => 0x73,
|
||||
0x0074 => 0x74,
|
||||
0x0075 => 0x75,
|
||||
0x0076 => 0x76,
|
||||
0x0077 => 0x77,
|
||||
0x0078 => 0x78,
|
||||
0x0079 => 0x79,
|
||||
0x007A => 0x7A,
|
||||
0x2660 => 0x7B,
|
||||
0x007C => 0x7C,
|
||||
0x1F8B0 => 0x7D,
|
||||
0x25C0 => 0x7E,
|
||||
0x25B6 => 0x7F,
|
||||
0x258A => 0x82,
|
||||
0x25E4 => 0x88,
|
||||
0x259B => 0x89,
|
||||
0x25E5 => 0x8A,
|
||||
0x2599 => 0x8B,
|
||||
0x259F => 0x8C,
|
||||
0x2586 => 0x8D,
|
||||
0x259C => 0x8F,
|
||||
0x25D8 => 0x94,
|
||||
0x2580 => 0x95,
|
||||
0x2590 => 0x99,
|
||||
0x000D => 0x9B,
|
||||
0x2588 => 0xA0,
|
||||
0x0007 => 0xFD,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Apple II character encoding of Unicode characters.</summary>
|
||||
public sealed class Apple2 : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "apple2";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Western European (Apple II)";
|
||||
public override string HeaderName => "apple2";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "apple2";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Western European (Apple II)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "apple2";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => false;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Apple II to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -146,78 +158,73 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an Apple II character</summary>
|
||||
/// <returns>Apple II character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -24,274 +24,337 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace Claunia.Encoding
|
||||
{
|
||||
/// <summary>Represents an Apple IIc character encoding of Unicode characters.</summary>
|
||||
public sealed class Apple2C : SingleByteEncoding
|
||||
public sealed class Apple2C : SingleByteEncodingWithRunes
|
||||
{
|
||||
public override string BodyName => "apple2c";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Western European (Apple IIc)";
|
||||
public override string HeaderName => "apple2c";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "apple2c";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Western European (Apple IIc)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "apple2c";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Apple IIc to Unicode character map. Inverted screen characters are mapped to normal characters.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
protected override Rune[] CharTable => new[]
|
||||
{
|
||||
// 0x00
|
||||
'\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007',
|
||||
new Rune(0x0000), new Rune(0x0001), new Rune(0x0002), new Rune(0x0003), new Rune(0x0004), new Rune(0x0005),
|
||||
new Rune(0x0006), new Rune(0x0007),
|
||||
|
||||
// 0x08
|
||||
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
|
||||
new Rune(0x0008), new Rune(0x0009), new Rune(0x000A), new Rune(0x000B), new Rune(0x000C), new Rune(0x000D),
|
||||
new Rune(0x000E), new Rune(0x000F),
|
||||
|
||||
// 0x10
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
|
||||
new Rune(0x0010), new Rune(0x0011), new Rune(0x0012), new Rune(0x0013), new Rune(0x0014), new Rune(0x0015),
|
||||
new Rune(0x0016), new Rune(0x0017),
|
||||
|
||||
// 0x18
|
||||
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
|
||||
new Rune(0x0018), new Rune(0x0019), new Rune(0x001A), new Rune(0x001B), new Rune(0x001C), new Rune(0x001D),
|
||||
new Rune(0x001E), new Rune(0x001F),
|
||||
|
||||
// 0x20
|
||||
'\u0020', '\u0021', '\u0022', '\u0023', '\u0024', '\u0025', '\u0026', '\u0027',
|
||||
new Rune(0x0020), new Rune(0x0021), new Rune(0x0022), new Rune(0x0023), new Rune(0x0024), new Rune(0x0025),
|
||||
new Rune(0x0026), new Rune(0x0027),
|
||||
|
||||
// 0x28
|
||||
'\u0028', '\u0029', '\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F',
|
||||
new Rune(0x0028), new Rune(0x0029), new Rune(0x002A), new Rune(0x002B), new Rune(0x002C), new Rune(0x002D),
|
||||
new Rune(0x002E), new Rune(0x002F),
|
||||
|
||||
// 0x30
|
||||
'\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037',
|
||||
new Rune(0x0030), new Rune(0x0031), new Rune(0x0032), new Rune(0x0033), new Rune(0x0034), new Rune(0x0035),
|
||||
new Rune(0x0036), new Rune(0x0037),
|
||||
|
||||
// 0x38
|
||||
'\u0038', '\u0039', '\u003A', '\u003B', '\u003C', '\u003D', '\u003E', '\u003F',
|
||||
new Rune(0x0038), new Rune(0x0039), new Rune(0x003A), new Rune(0x003B), new Rune(0x003C), new Rune(0x003D),
|
||||
new Rune(0x003E), new Rune(0x003F),
|
||||
|
||||
// 0x40
|
||||
'\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047',
|
||||
new Rune(0x0040), new Rune(0x0041), new Rune(0x0042), new Rune(0x0043), new Rune(0x0044), new Rune(0x0045),
|
||||
new Rune(0x0046), new Rune(0x0047),
|
||||
|
||||
// 0x48
|
||||
'\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D', '\u004E', '\u004F',
|
||||
new Rune(0x0048), new Rune(0x0049), new Rune(0x004A), new Rune(0x004B), new Rune(0x004C), new Rune(0x004D),
|
||||
new Rune(0x004E), new Rune(0x004F),
|
||||
|
||||
// 0x50
|
||||
'\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057',
|
||||
new Rune(0x0050), new Rune(0x0051), new Rune(0x0052), new Rune(0x0053), new Rune(0x0054), new Rune(0x0055),
|
||||
new Rune(0x0056), new Rune(0x0057),
|
||||
|
||||
// 0x58
|
||||
'\u0058', '\u0059', '\u005A', '\u005B', '\u00A3', '\u005D', '\u005E', '\u005F',
|
||||
new Rune(0x0058), new Rune(0x0059), new Rune(0x005A), new Rune(0x005B), new Rune(0x00A3), new Rune(0x005D),
|
||||
new Rune(0x005E), new Rune(0x005F),
|
||||
|
||||
// 0x60
|
||||
'\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065', '\u0066', '\u0067',
|
||||
new Rune(0x0060), new Rune(0x0061), new Rune(0x0062), new Rune(0x0063), new Rune(0x0064), new Rune(0x0065),
|
||||
new Rune(0x0066), new Rune(0x0067),
|
||||
|
||||
// 0x68
|
||||
'\u0068', '\u0069', '\u006A', '\u006B', '\u006C', '\u006D', '\u006E', '\u006F',
|
||||
new Rune(0x0068), new Rune(0x0069), new Rune(0x006A), new Rune(0x006B), new Rune(0x006C), new Rune(0x006D),
|
||||
new Rune(0x006E), new Rune(0x006F),
|
||||
|
||||
// 0x70
|
||||
'\u0070', '\u0071', '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077',
|
||||
new Rune(0x0070), new Rune(0x0071), new Rune(0x0072), new Rune(0x0073), new Rune(0x0074), new Rune(0x0075),
|
||||
new Rune(0x0076), new Rune(0x0077),
|
||||
|
||||
// 0x78
|
||||
'\u0078', '\u0079', '\u007A', '\u007B', '\u007C', '\u007D', '\u007E', '\u007F',
|
||||
new Rune(0x0078), new Rune(0x0079), new Rune(0x007A), new Rune(0x007B), new Rune(0x007C), new Rune(0x007D),
|
||||
new Rune(0x007E), new Rune(0x007F),
|
||||
|
||||
// 0x80
|
||||
'\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047',
|
||||
new Rune(0x0040), new Rune(0x0041), new Rune(0x0042), new Rune(0x0043), new Rune(0x0044), new Rune(0x0045),
|
||||
new Rune(0x0046), new Rune(0x0047),
|
||||
|
||||
// 0x88
|
||||
'\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D', '\u004E', '\u004F',
|
||||
new Rune(0x0048), new Rune(0x0049), new Rune(0x004A), new Rune(0x004B), new Rune(0x004C), new Rune(0x004D),
|
||||
new Rune(0x004E), new Rune(0x004F),
|
||||
|
||||
// 0x90
|
||||
'\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057',
|
||||
new Rune(0x0050), new Rune(0x0051), new Rune(0x0052), new Rune(0x0053), new Rune(0x0054), new Rune(0x0055),
|
||||
new Rune(0x0056), new Rune(0x0057),
|
||||
|
||||
// 0x98
|
||||
'\u0058', '\u0059', '\u005A', '\u005B', '\u00A3', '\u005D', '\u005E', '\u0020',
|
||||
new Rune(0x0058), new Rune(0x0059), new Rune(0x005A), new Rune(0x005B), new Rune(0x00A3), new Rune(0x005D),
|
||||
new Rune(0x005E), new Rune(0x0020),
|
||||
|
||||
// 0xA0
|
||||
'\u2588', '\u0021', '\u0022', '\u0023', '\u0024', '\u0025', '\u0026', '\u0027',
|
||||
new Rune(0x2588), new Rune(0x0021), new Rune(0x0022), new Rune(0x0023), new Rune(0x0024), new Rune(0x0025),
|
||||
new Rune(0x0026), new Rune(0x0027),
|
||||
|
||||
// 0xA8
|
||||
'\u0028', '\u0029', '\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F',
|
||||
new Rune(0x0028), new Rune(0x0029), new Rune(0x002A), new Rune(0x002B), new Rune(0x002C), new Rune(0x002D),
|
||||
new Rune(0x002E), new Rune(0x002F),
|
||||
|
||||
// 0xB0
|
||||
'\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037',
|
||||
new Rune(0x0030), new Rune(0x0031), new Rune(0x0032), new Rune(0x0033), new Rune(0x0034), new Rune(0x0035),
|
||||
new Rune(0x0036), new Rune(0x0037),
|
||||
|
||||
// 0xB8
|
||||
'\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037',
|
||||
new Rune(0x0030), new Rune(0x0031), new Rune(0x0032), new Rune(0x0033), new Rune(0x0034), new Rune(0x0035),
|
||||
new Rune(0x0036), new Rune(0x0037),
|
||||
|
||||
// 0xC0
|
||||
'\u0000', '\u0000', '\u0000', '\u231B', '\u2713', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0xF8FF), new Rune(0x0000), new Rune(0x1FBB0), new Rune(0x231B), new Rune(0x2713),
|
||||
new Rune(0x1FBB1), new Rune(0x1FBB2), new Rune(0x1FBB3),
|
||||
|
||||
// 0xC8
|
||||
'\u2190', '\u2026', '\u2193', '\u2191', '\u0000', '\u21B5', '\u0000', '\u0000',
|
||||
new Rune(0x2190), new Rune(0x2026), new Rune(0x2193), new Rune(0x2191), new Rune(0x1FB76), new Rune(0x21B5),
|
||||
new Rune(0x2589), new Rune(0x1FBB5),
|
||||
|
||||
// 0xD0
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u2192', '\u0000', '\u0000',
|
||||
new Rune(0x1FBB6), new Rune(0x1FBB7), new Rune(0x1FBB8), new Rune(0x2500), new Rune(0x1FB7C),
|
||||
new Rune(0x2192), new Rune(0x2592), new Rune(0x1FB90),
|
||||
|
||||
// 0xD8
|
||||
'\u0000', '\u0000', '\u0000', '\u25c6', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x1FBB9), new Rune(0x1FBBA), new Rune(0x2595), new Rune(0x25c6), new Rune(0x1FB80),
|
||||
new Rune(0x1FBBB), new Rune(0x1FBBC), new Rune(0x258F),
|
||||
|
||||
// 0xE0
|
||||
'\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065', '\u0066', '\u0067',
|
||||
new Rune(0x0060), new Rune(0x0061), new Rune(0x0062), new Rune(0x0063), new Rune(0x0064), new Rune(0x0065),
|
||||
new Rune(0x0066), new Rune(0x0067),
|
||||
|
||||
// 0xE8
|
||||
'\u0068', '\u0069', '\u006A', '\u006B', '\u006C', '\u006D', '\u006E', '\u006F',
|
||||
new Rune(0x0068), new Rune(0x0069), new Rune(0x006A), new Rune(0x006B), new Rune(0x006C), new Rune(0x006D),
|
||||
new Rune(0x006E), new Rune(0x006F),
|
||||
|
||||
// 0xF0
|
||||
'\u0070', '\u0071', '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077',
|
||||
new Rune(0x0070), new Rune(0x0071), new Rune(0x0072), new Rune(0x0073), new Rune(0x0074), new Rune(0x0075),
|
||||
new Rune(0x0076), new Rune(0x0077),
|
||||
|
||||
// 0xF8
|
||||
'\u0078', '\u0079', '\u007A', '\u007B', '\u007C', '\u007D', '\u007E', '\u007F'
|
||||
new Rune(0x0078), new Rune(0x0079), new Rune(0x007A), new Rune(0x007B), new Rune(0x007C), new Rune(0x007D),
|
||||
new Rune(0x007E), new Rune(0x007F)
|
||||
};
|
||||
|
||||
/// <summary>Converts a Unicode character to an Apple IIc character</summary>
|
||||
/// <returns>Apple IIc character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(Rune character) => character.Value switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u00A3': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u2588': return 0xA0;
|
||||
case '\u231B': return 0xC3;
|
||||
case '\u2713': return 0xC4;
|
||||
case '\u2190': return 0xC8;
|
||||
case '\u2026': return 0xC9;
|
||||
case '\u2193': return 0xCA;
|
||||
case '\u2191': return 0xCB;
|
||||
case '\u21B5': return 0xCD;
|
||||
case '\u2192': return 0xD5;
|
||||
case '\u25C6': return 0xDB;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
0x0000 => 0x00,
|
||||
0x0001 => 0x01,
|
||||
0x0002 => 0x02,
|
||||
0x0003 => 0x03,
|
||||
0x0004 => 0x04,
|
||||
0x0005 => 0x05,
|
||||
0x0006 => 0x06,
|
||||
0x0007 => 0x07,
|
||||
0x0008 => 0x08,
|
||||
0x0009 => 0x09,
|
||||
0x000A => 0x0A,
|
||||
0x000B => 0x0B,
|
||||
0x000C => 0x0C,
|
||||
0x000D => 0x0D,
|
||||
0x000E => 0x0E,
|
||||
0x000F => 0x0F,
|
||||
0x0010 => 0x10,
|
||||
0x0011 => 0x11,
|
||||
0x0012 => 0x12,
|
||||
0x0013 => 0x13,
|
||||
0x0014 => 0x14,
|
||||
0x0015 => 0x15,
|
||||
0x0016 => 0x16,
|
||||
0x0017 => 0x17,
|
||||
0x0018 => 0x18,
|
||||
0x0019 => 0x19,
|
||||
0x001A => 0x1A,
|
||||
0x001B => 0x1B,
|
||||
0x001C => 0x1C,
|
||||
0x001D => 0x1D,
|
||||
0x001E => 0x1E,
|
||||
0x001F => 0x1F,
|
||||
0x0020 => 0x20,
|
||||
0x0021 => 0x21,
|
||||
0x0022 => 0x22,
|
||||
0x0023 => 0x23,
|
||||
0x0024 => 0x24,
|
||||
0x0025 => 0x25,
|
||||
0x0026 => 0x26,
|
||||
0x0027 => 0x27,
|
||||
0x0028 => 0x28,
|
||||
0x0029 => 0x29,
|
||||
0x002A => 0x2A,
|
||||
0x002B => 0x2B,
|
||||
0x002C => 0x2C,
|
||||
0x002D => 0x2D,
|
||||
0x002E => 0x2E,
|
||||
0x002F => 0x2F,
|
||||
0x0030 => 0x30,
|
||||
0x0031 => 0x31,
|
||||
0x0032 => 0x32,
|
||||
0x0033 => 0x33,
|
||||
0x0034 => 0x34,
|
||||
0x0035 => 0x35,
|
||||
0x0036 => 0x36,
|
||||
0x0037 => 0x37,
|
||||
0x0038 => 0x38,
|
||||
0x0039 => 0x39,
|
||||
0x003A => 0x3A,
|
||||
0x003B => 0x3B,
|
||||
0x003C => 0x3C,
|
||||
0x003D => 0x3D,
|
||||
0x003E => 0x3E,
|
||||
0x003F => 0x3F,
|
||||
0x0040 => 0x40,
|
||||
0x0041 => 0x41,
|
||||
0x0042 => 0x42,
|
||||
0x0043 => 0x43,
|
||||
0x0044 => 0x44,
|
||||
0x0045 => 0x45,
|
||||
0x0046 => 0x46,
|
||||
0x0047 => 0x47,
|
||||
0x0048 => 0x48,
|
||||
0x0049 => 0x49,
|
||||
0x004A => 0x4A,
|
||||
0x004B => 0x4B,
|
||||
0x004C => 0x4C,
|
||||
0x004D => 0x4D,
|
||||
0x004E => 0x4E,
|
||||
0x004F => 0x4F,
|
||||
0x0050 => 0x50,
|
||||
0x0051 => 0x51,
|
||||
0x0052 => 0x52,
|
||||
0x0053 => 0x53,
|
||||
0x0054 => 0x54,
|
||||
0x0055 => 0x55,
|
||||
0x0056 => 0x56,
|
||||
0x0057 => 0x57,
|
||||
0x0058 => 0x58,
|
||||
0x0059 => 0x59,
|
||||
0x005A => 0x5A,
|
||||
0x005B => 0x5B,
|
||||
0x00A3 => 0x5C,
|
||||
0x005D => 0x5D,
|
||||
0x005E => 0x5E,
|
||||
0x005F => 0x5F,
|
||||
0x0060 => 0x60,
|
||||
0x0061 => 0x61,
|
||||
0x0062 => 0x62,
|
||||
0x0063 => 0x63,
|
||||
0x0064 => 0x64,
|
||||
0x0065 => 0x65,
|
||||
0x0066 => 0x66,
|
||||
0x0067 => 0x67,
|
||||
0x0068 => 0x68,
|
||||
0x0069 => 0x69,
|
||||
0x006A => 0x6A,
|
||||
0x006B => 0x6B,
|
||||
0x006C => 0x6C,
|
||||
0x006D => 0x6D,
|
||||
0x006E => 0x6E,
|
||||
0x006F => 0x6F,
|
||||
0x0070 => 0x70,
|
||||
0x0071 => 0x71,
|
||||
0x0072 => 0x72,
|
||||
0x0073 => 0x73,
|
||||
0x0074 => 0x74,
|
||||
0x0075 => 0x75,
|
||||
0x0076 => 0x76,
|
||||
0x0077 => 0x77,
|
||||
0x0078 => 0x78,
|
||||
0x0079 => 0x79,
|
||||
0x007A => 0x7A,
|
||||
0x007B => 0x7B,
|
||||
0x007C => 0x7C,
|
||||
0x007D => 0x7D,
|
||||
0x007E => 0x7E,
|
||||
0x007F => 0x7F,
|
||||
0x2588 => 0xA0,
|
||||
0xF8FF => 0xC0,
|
||||
0x1FBB0 => 0xC2,
|
||||
0x231B => 0xC3,
|
||||
0x2713 => 0xC4,
|
||||
0x1FBB1 => 0xC5,
|
||||
0x1FBB2 => 0xC6,
|
||||
0x1FBB3 => 0xC7,
|
||||
0x2190 => 0xC8,
|
||||
0x2026 => 0xC9,
|
||||
0x2193 => 0xCA,
|
||||
0x2191 => 0xCB,
|
||||
0x1FB76 => 0xCC,
|
||||
0x21B5 => 0xCD,
|
||||
0x2589 => 0xCE,
|
||||
0x1FBB5 => 0xCF,
|
||||
0x1FBB6 => 0xD0,
|
||||
0x1FBB7 => 0xD1,
|
||||
0x1FBB8 => 0xD2,
|
||||
0x2500 => 0xD3,
|
||||
0x1FB7C => 0xD4,
|
||||
0x2192 => 0xD5,
|
||||
0x2592 => 0xD6,
|
||||
0x1FB90 => 0xD7,
|
||||
0x1FBB9 => 0xD8,
|
||||
0x1FBBA => 0xD9,
|
||||
0x2595 => 0xDA,
|
||||
0x25C6 => 0xDB,
|
||||
0x1FB80 => 0xDC,
|
||||
0x1FBBB => 0xDD,
|
||||
0x1FBBC => 0xDE,
|
||||
0x258F => 0xDF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Apple IIe character encoding of Unicode characters.</summary>
|
||||
public class Apple2E : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "apple2e";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Western European (Apple IIe)";
|
||||
public override string HeaderName => "apple2e";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "apple2e";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Western European (Apple IIe)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "apple2e";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Apple IIe to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -146,139 +158,134 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an Apple IIe character</summary>
|
||||
/// <returns>Apple IIe character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0020': return 0x00;
|
||||
case '\u0021': return 0x01;
|
||||
case '\u0022': return 0x02;
|
||||
case '\u0023': return 0x03;
|
||||
case '\u0024': return 0x04;
|
||||
case '\u0025': return 0x05;
|
||||
case '\u0026': return 0x06;
|
||||
case '\u0027': return 0x07;
|
||||
case '\u0028': return 0x08;
|
||||
case '\u0029': return 0x09;
|
||||
case '\u002A': return 0x0A;
|
||||
case '\u002B': return 0x0B;
|
||||
case '\u002C': return 0x0C;
|
||||
case '\u002D': return 0x0D;
|
||||
case '\u002E': return 0x0E;
|
||||
case '\u002F': return 0x0F;
|
||||
case '\u0030': return 0x10;
|
||||
case '\u0031': return 0x11;
|
||||
case '\u0032': return 0x12;
|
||||
case '\u0033': return 0x13;
|
||||
case '\u0034': return 0x14;
|
||||
case '\u0035': return 0x15;
|
||||
case '\u0036': return 0x16;
|
||||
case '\u0037': return 0x17;
|
||||
case '\u0038': return 0x18;
|
||||
case '\u0039': return 0x19;
|
||||
case '\u003A': return 0x1A;
|
||||
case '\u003B': return 0x1B;
|
||||
case '\u003C': return 0x1C;
|
||||
case '\u003D': return 0x1D;
|
||||
case '\u003E': return 0x1E;
|
||||
case '\u003F': return 0x1F;
|
||||
case '\u0040': return 0x20;
|
||||
case '\u0061': return 0x21;
|
||||
case '\u0062': return 0x22;
|
||||
case '\u0063': return 0x23;
|
||||
case '\u0064': return 0x24;
|
||||
case '\u0065': return 0x25;
|
||||
case '\u0066': return 0x26;
|
||||
case '\u0067': return 0x27;
|
||||
case '\u0068': return 0x28;
|
||||
case '\u0069': return 0x29;
|
||||
case '\u006A': return 0x2A;
|
||||
case '\u006B': return 0x2B;
|
||||
case '\u006C': return 0x2C;
|
||||
case '\u006D': return 0x2D;
|
||||
case '\u006E': return 0x2E;
|
||||
case '\u006F': return 0x2F;
|
||||
case '\u0070': return 0x30;
|
||||
case '\u0071': return 0x31;
|
||||
case '\u0072': return 0x32;
|
||||
case '\u0073': return 0x33;
|
||||
case '\u0074': return 0x34;
|
||||
case '\u0075': return 0x35;
|
||||
case '\u0076': return 0x36;
|
||||
case '\u0077': return 0x37;
|
||||
case '\u0078': return 0x38;
|
||||
case '\u0079': return 0x39;
|
||||
case '\u007A': return 0x3A;
|
||||
case '\u005B': return 0x3B;
|
||||
case '\u005C': return 0x3C;
|
||||
case '\u005D': return 0x3D;
|
||||
case '\u005E': return 0x3E;
|
||||
case '\u005F': return 0x3F;
|
||||
case '\u00A0': return 0x40;
|
||||
case '\u2575': return 0x41;
|
||||
case '\u2574': return 0x42;
|
||||
case '\u2577': return 0x43;
|
||||
case '\u2576': return 0x44;
|
||||
case '\u2518': return 0x45;
|
||||
case '\u2510': return 0x46;
|
||||
case '\u250C': return 0x47;
|
||||
case '\u2514': return 0x48;
|
||||
case '\u2500': return 0x49;
|
||||
case '\u2502': return 0x4A;
|
||||
case '\u2534': return 0x4B;
|
||||
case '\u2524': return 0x4C;
|
||||
case '\u252C': return 0x4D;
|
||||
case '\u251C': return 0x4E;
|
||||
case '\u253C': return 0x4F;
|
||||
case '\u25E4': return 0x50;
|
||||
case '\u25E5': return 0x51;
|
||||
case '\u2592': return 0x52;
|
||||
case '\u2598': return 0x53;
|
||||
case '\u259D': return 0x54;
|
||||
case '\u2580': return 0x55;
|
||||
case '\u2596': return 0x56;
|
||||
case '\u2597': return 0x57;
|
||||
case '\u259A': return 0x58;
|
||||
case '\u258C': return 0x59;
|
||||
case '\u2190': return 0x5C;
|
||||
case '\u2191': return 0x5D;
|
||||
case '\u2192': return 0x5E;
|
||||
case '\u2193': return 0x5F;
|
||||
case '\u03C0': return 0x60;
|
||||
case '\u0041': return 0x61;
|
||||
case '\u0042': return 0x62;
|
||||
case '\u0043': return 0x63;
|
||||
case '\u0044': return 0x64;
|
||||
case '\u0045': return 0x65;
|
||||
case '\u0046': return 0x66;
|
||||
case '\u0047': return 0x67;
|
||||
case '\u0048': return 0x68;
|
||||
case '\u0049': return 0x69;
|
||||
case '\u004A': return 0x6A;
|
||||
case '\u004B': return 0x6B;
|
||||
case '\u004C': return 0x6C;
|
||||
case '\u004D': return 0x6D;
|
||||
case '\u004E': return 0x6E;
|
||||
case '\u004F': return 0x6F;
|
||||
case '\u0050': return 0x70;
|
||||
case '\u0051': return 0x71;
|
||||
case '\u0052': return 0x72;
|
||||
case '\u0053': return 0x73;
|
||||
case '\u0054': return 0x74;
|
||||
case '\u0055': return 0x75;
|
||||
case '\u0056': return 0x76;
|
||||
case '\u0057': return 0x77;
|
||||
case '\u0058': return 0x78;
|
||||
case '\u0059': return 0x79;
|
||||
case '\u005A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0020' => 0x00,
|
||||
'\u0021' => 0x01,
|
||||
'\u0022' => 0x02,
|
||||
'\u0023' => 0x03,
|
||||
'\u0024' => 0x04,
|
||||
'\u0025' => 0x05,
|
||||
'\u0026' => 0x06,
|
||||
'\u0027' => 0x07,
|
||||
'\u0028' => 0x08,
|
||||
'\u0029' => 0x09,
|
||||
'\u002A' => 0x0A,
|
||||
'\u002B' => 0x0B,
|
||||
'\u002C' => 0x0C,
|
||||
'\u002D' => 0x0D,
|
||||
'\u002E' => 0x0E,
|
||||
'\u002F' => 0x0F,
|
||||
'\u0030' => 0x10,
|
||||
'\u0031' => 0x11,
|
||||
'\u0032' => 0x12,
|
||||
'\u0033' => 0x13,
|
||||
'\u0034' => 0x14,
|
||||
'\u0035' => 0x15,
|
||||
'\u0036' => 0x16,
|
||||
'\u0037' => 0x17,
|
||||
'\u0038' => 0x18,
|
||||
'\u0039' => 0x19,
|
||||
'\u003A' => 0x1A,
|
||||
'\u003B' => 0x1B,
|
||||
'\u003C' => 0x1C,
|
||||
'\u003D' => 0x1D,
|
||||
'\u003E' => 0x1E,
|
||||
'\u003F' => 0x1F,
|
||||
'\u0040' => 0x20,
|
||||
'\u0061' => 0x21,
|
||||
'\u0062' => 0x22,
|
||||
'\u0063' => 0x23,
|
||||
'\u0064' => 0x24,
|
||||
'\u0065' => 0x25,
|
||||
'\u0066' => 0x26,
|
||||
'\u0067' => 0x27,
|
||||
'\u0068' => 0x28,
|
||||
'\u0069' => 0x29,
|
||||
'\u006A' => 0x2A,
|
||||
'\u006B' => 0x2B,
|
||||
'\u006C' => 0x2C,
|
||||
'\u006D' => 0x2D,
|
||||
'\u006E' => 0x2E,
|
||||
'\u006F' => 0x2F,
|
||||
'\u0070' => 0x30,
|
||||
'\u0071' => 0x31,
|
||||
'\u0072' => 0x32,
|
||||
'\u0073' => 0x33,
|
||||
'\u0074' => 0x34,
|
||||
'\u0075' => 0x35,
|
||||
'\u0076' => 0x36,
|
||||
'\u0077' => 0x37,
|
||||
'\u0078' => 0x38,
|
||||
'\u0079' => 0x39,
|
||||
'\u007A' => 0x3A,
|
||||
'\u005B' => 0x3B,
|
||||
'\u005C' => 0x3C,
|
||||
'\u005D' => 0x3D,
|
||||
'\u005E' => 0x3E,
|
||||
'\u005F' => 0x3F,
|
||||
'\u00A0' => 0x40,
|
||||
'\u2575' => 0x41,
|
||||
'\u2574' => 0x42,
|
||||
'\u2577' => 0x43,
|
||||
'\u2576' => 0x44,
|
||||
'\u2518' => 0x45,
|
||||
'\u2510' => 0x46,
|
||||
'\u250C' => 0x47,
|
||||
'\u2514' => 0x48,
|
||||
'\u2500' => 0x49,
|
||||
'\u2502' => 0x4A,
|
||||
'\u2534' => 0x4B,
|
||||
'\u2524' => 0x4C,
|
||||
'\u252C' => 0x4D,
|
||||
'\u251C' => 0x4E,
|
||||
'\u253C' => 0x4F,
|
||||
'\u25E4' => 0x50,
|
||||
'\u25E5' => 0x51,
|
||||
'\u2592' => 0x52,
|
||||
'\u2598' => 0x53,
|
||||
'\u259D' => 0x54,
|
||||
'\u2580' => 0x55,
|
||||
'\u2596' => 0x56,
|
||||
'\u2597' => 0x57,
|
||||
'\u259A' => 0x58,
|
||||
'\u258C' => 0x59,
|
||||
'\u2190' => 0x5C,
|
||||
'\u2191' => 0x5D,
|
||||
'\u2192' => 0x5E,
|
||||
'\u2193' => 0x5F,
|
||||
'\u03C0' => 0x60,
|
||||
'\u0041' => 0x61,
|
||||
'\u0042' => 0x62,
|
||||
'\u0043' => 0x63,
|
||||
'\u0044' => 0x64,
|
||||
'\u0045' => 0x65,
|
||||
'\u0046' => 0x66,
|
||||
'\u0047' => 0x67,
|
||||
'\u0048' => 0x68,
|
||||
'\u0049' => 0x69,
|
||||
'\u004A' => 0x6A,
|
||||
'\u004B' => 0x6B,
|
||||
'\u004C' => 0x6C,
|
||||
'\u004D' => 0x6D,
|
||||
'\u004E' => 0x6E,
|
||||
'\u004F' => 0x6F,
|
||||
'\u0050' => 0x70,
|
||||
'\u0051' => 0x71,
|
||||
'\u0052' => 0x72,
|
||||
'\u0053' => 0x73,
|
||||
'\u0054' => 0x74,
|
||||
'\u0055' => 0x75,
|
||||
'\u0056' => 0x76,
|
||||
'\u0057' => 0x77,
|
||||
'\u0058' => 0x78,
|
||||
'\u0059' => 0x79,
|
||||
'\u005A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -24,241 +24,304 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace Claunia.Encoding
|
||||
{
|
||||
/// <summary>Represents an Apple IIgs character encoding of Unicode characters.</summary>
|
||||
public class Apple2Gs : SingleByteEncoding
|
||||
public class Apple2Gs : SingleByteEncodingWithRunes
|
||||
{
|
||||
public override string BodyName => "apple2gs";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Western European (Apple IIgs)";
|
||||
public override string HeaderName => "apple2gs";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "apple2gs";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Western European (Apple IIgs)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "apple2gs";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Apple IIgs to Unicode character map. Inverted screen characters are mapped to normal characters.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
protected override Rune[] CharTable => new[]
|
||||
{
|
||||
// 0x00
|
||||
'\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047',
|
||||
new Rune(0x0040), new Rune(0x0041), new Rune(0x0042), new Rune(0x0043), new Rune(0x0044), new Rune(0x0045),
|
||||
new Rune(0x0046), new Rune(0x0047),
|
||||
|
||||
// 0x08
|
||||
'\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D', '\u004E', '\u004F',
|
||||
new Rune(0x0048), new Rune(0x0049), new Rune(0x004A), new Rune(0x004B), new Rune(0x004C), new Rune(0x004D),
|
||||
new Rune(0x004E), new Rune(0x004F),
|
||||
|
||||
// 0x10
|
||||
'\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057',
|
||||
new Rune(0x0050), new Rune(0x0051), new Rune(0x0052), new Rune(0x0053), new Rune(0x0054), new Rune(0x0055),
|
||||
new Rune(0x0056), new Rune(0x0057),
|
||||
|
||||
// 0x18
|
||||
'\u0058', '\u0059', '\u005A', '\u005B', '\u005C', '\u005D', '\u005E', '\u0020',
|
||||
new Rune(0x0058), new Rune(0x0059), new Rune(0x005A), new Rune(0x005B), new Rune(0x005C), new Rune(0x005D),
|
||||
new Rune(0x005E), new Rune(0x0020),
|
||||
|
||||
// 0x20
|
||||
'\u2588', '\u0021', '\u0022', '\u0023', '\u0024', '\u0025', '\u0026', '\u0027',
|
||||
new Rune(0x2588), new Rune(0x0021), new Rune(0x0022), new Rune(0x0023), new Rune(0x0024), new Rune(0x0025),
|
||||
new Rune(0x0026), new Rune(0x0027),
|
||||
|
||||
// 0x28
|
||||
'\u0028', '\u0029', '\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F',
|
||||
new Rune(0x0028), new Rune(0x0029), new Rune(0x002A), new Rune(0x002B), new Rune(0x002C), new Rune(0x002D),
|
||||
new Rune(0x002E), new Rune(0x002F),
|
||||
|
||||
// 0x30
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x38
|
||||
'\u0038', '\u0039', '\u003A', '\u003B', '\u003C', '\u003D', '\u003E', '\u003F',
|
||||
new Rune(0x0038), new Rune(0x0039), new Rune(0x003A), new Rune(0x003B), new Rune(0x003C), new Rune(0x003D),
|
||||
new Rune(0x003E), new Rune(0x003F),
|
||||
|
||||
// 0x40
|
||||
'\u0000', '\u0000', '\u0000', '\u231B', '\u2713', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0xF8FF), new Rune(0x0000), new Rune(0x1FBB0), new Rune(0x231B), new Rune(0x2713),
|
||||
new Rune(0x1FBB1), new Rune(0x1FBB4), new Rune(0x1FB81),
|
||||
|
||||
// 0x48
|
||||
'\u2190', '\u2026', '\u2193', '\u2191', '\u0000', '\u21B5', '\u0000', '\u0000',
|
||||
new Rune(0x2190), new Rune(0x2026), new Rune(0x2193), new Rune(0x2191), new Rune(0x2594), new Rune(0x21B5),
|
||||
new Rune(0x2589), new Rune(0x1FBB5),
|
||||
|
||||
// 0x50
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u2192', '\u0000', '\u0000',
|
||||
new Rune(0x1FBB6), new Rune(0x1FBB7), new Rune(0x1FBB8), new Rune(0x2500), new Rune(0x1FB7C),
|
||||
new Rune(0x2192), new Rune(0x2592), new Rune(0x1FB90),
|
||||
|
||||
// 0x58
|
||||
'\u0000', '\u0000', '\u0000', '\u25C6', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x1FBB9), new Rune(0x1FBBA), new Rune(0x2595), new Rune(0x25C6), new Rune(0x1FB80),
|
||||
new Rune(0x1FBBB), new Rune(0x1FBBC), new Rune(0x258F),
|
||||
|
||||
// 0x60
|
||||
'\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065', '\u0066', '\u0067',
|
||||
new Rune(0x0060), new Rune(0x0061), new Rune(0x0062), new Rune(0x0063), new Rune(0x0064), new Rune(0x0065),
|
||||
new Rune(0x0066), new Rune(0x0067),
|
||||
|
||||
// 0x68
|
||||
'\u0068', '\u0069', '\u006A', '\u006B', '\u006C', '\u006D', '\u006E', '\u006F',
|
||||
new Rune(0x0068), new Rune(0x0069), new Rune(0x006A), new Rune(0x006B), new Rune(0x006C), new Rune(0x006D),
|
||||
new Rune(0x006E), new Rune(0x006F),
|
||||
|
||||
// 0x70
|
||||
'\u0070', '\u0071', '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077',
|
||||
new Rune(0x0070), new Rune(0x0071), new Rune(0x0072), new Rune(0x0073), new Rune(0x0074), new Rune(0x0075),
|
||||
new Rune(0x0076), new Rune(0x0077),
|
||||
|
||||
// 0x78
|
||||
'\u0078', '\u0079', '\u007A', '\u007B', '\u007C', '\u007D', '\u007E', '\u0000',
|
||||
new Rune(0x0078), new Rune(0x0079), new Rune(0x007A), new Rune(0x007B), new Rune(0x007C), new Rune(0x007D),
|
||||
new Rune(0x007E), new Rune(0x0000),
|
||||
|
||||
// 0x80
|
||||
'\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047',
|
||||
new Rune(0x0040), new Rune(0x0041), new Rune(0x0042), new Rune(0x0043), new Rune(0x0044), new Rune(0x0045),
|
||||
new Rune(0x0046), new Rune(0x0047),
|
||||
|
||||
// 0x88
|
||||
'\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D', '\u004E', '\u004F',
|
||||
new Rune(0x0048), new Rune(0x0049), new Rune(0x004A), new Rune(0x004B), new Rune(0x004C), new Rune(0x004D),
|
||||
new Rune(0x004E), new Rune(0x004F),
|
||||
|
||||
// 0x90
|
||||
'\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057',
|
||||
new Rune(0x0050), new Rune(0x0051), new Rune(0x0052), new Rune(0x0053), new Rune(0x0054), new Rune(0x0055),
|
||||
new Rune(0x0056), new Rune(0x0057),
|
||||
|
||||
// 0x98
|
||||
'\u0058', '\u0059', '\u005A', '\u005B', '\u005C', '\u005D', '\u005E', '\u005F',
|
||||
new Rune(0x0058), new Rune(0x0059), new Rune(0x005A), new Rune(0x005B), new Rune(0x005C), new Rune(0x005D),
|
||||
new Rune(0x005E), new Rune(0x005F),
|
||||
|
||||
// 0xA0
|
||||
'\u0020', '\u0021', '\u0022', '\u0023', '\u0024', '\u0025', '\u0026', '\u0027',
|
||||
new Rune(0x0020), new Rune(0x0021), new Rune(0x0022), new Rune(0x0023), new Rune(0x0024), new Rune(0x0025),
|
||||
new Rune(0x0026), new Rune(0x0027),
|
||||
|
||||
// 0xA8
|
||||
'\u0028', '\u0029', '\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F',
|
||||
new Rune(0x0028), new Rune(0x0029), new Rune(0x002A), new Rune(0x002B), new Rune(0x002C), new Rune(0x002D),
|
||||
new Rune(0x002E), new Rune(0x002F),
|
||||
|
||||
// 0xB0
|
||||
'\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037',
|
||||
new Rune(0x0030), new Rune(0x0031), new Rune(0x0032), new Rune(0x0033), new Rune(0x0034), new Rune(0x0035),
|
||||
new Rune(0x0036), new Rune(0x0037),
|
||||
|
||||
// 0xB8
|
||||
'\u0038', '\u0039', '\u003A', '\u003B', '\u003C', '\u003D', '\u003E', '\u003F',
|
||||
new Rune(0x0038), new Rune(0x0039), new Rune(0x003A), new Rune(0x003B), new Rune(0x003C), new Rune(0x003D),
|
||||
new Rune(0x003E), new Rune(0x003F),
|
||||
|
||||
// 0xC0
|
||||
'\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047',
|
||||
new Rune(0x0040), new Rune(0x0041), new Rune(0x0042), new Rune(0x0043), new Rune(0x0044), new Rune(0x0045),
|
||||
new Rune(0x0046), new Rune(0x0047),
|
||||
|
||||
// 0xC8
|
||||
'\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D', '\u004E', '\u004F',
|
||||
new Rune(0x0048), new Rune(0x0049), new Rune(0x004A), new Rune(0x004B), new Rune(0x004C), new Rune(0x004D),
|
||||
new Rune(0x004E), new Rune(0x004F),
|
||||
|
||||
// 0xD0
|
||||
'\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057',
|
||||
new Rune(0x0050), new Rune(0x0051), new Rune(0x0052), new Rune(0x0053), new Rune(0x0054), new Rune(0x0055),
|
||||
new Rune(0x0056), new Rune(0x0057),
|
||||
|
||||
// 0xD8
|
||||
'\u0058', '\u0059', '\u005A', '\u005B', '\u005C', '\u005D', '\u005E', '\u005F',
|
||||
new Rune(0x0058), new Rune(0x0059), new Rune(0x005A), new Rune(0x005B), new Rune(0x005C), new Rune(0x005D),
|
||||
new Rune(0x005E), new Rune(0x005F),
|
||||
|
||||
// 0xE0
|
||||
'\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065', '\u0066', '\u0067',
|
||||
new Rune(0x0060), new Rune(0x0061), new Rune(0x0062), new Rune(0x0063), new Rune(0x0064), new Rune(0x0065),
|
||||
new Rune(0x0066), new Rune(0x0067),
|
||||
|
||||
// 0xE8
|
||||
'\u0068', '\u0069', '\u006A', '\u006B', '\u006C', '\u006D', '\u006E', '\u006F',
|
||||
new Rune(0x0068), new Rune(0x0069), new Rune(0x006A), new Rune(0x006B), new Rune(0x006C), new Rune(0x006D),
|
||||
new Rune(0x006E), new Rune(0x006F),
|
||||
|
||||
// 0xF0
|
||||
'\u0070', '\u0071', '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077',
|
||||
new Rune(0x0070), new Rune(0x0071), new Rune(0x0072), new Rune(0x0073), new Rune(0x0074), new Rune(0x0075),
|
||||
new Rune(0x0076), new Rune(0x0077),
|
||||
|
||||
// 0xF8
|
||||
'\u0078', '\u0079', '\u007A', '\u007B', '\u007C', '\u007D', '\u007E', '\u0000'
|
||||
new Rune(0x0078), new Rune(0x0079), new Rune(0x007A), new Rune(0x007B), new Rune(0x007C), new Rune(0x007D),
|
||||
new Rune(0x007E), new Rune(0x0000)
|
||||
};
|
||||
|
||||
/// <summary>Converts a Unicode character to an Apple IIgs character</summary>
|
||||
/// <returns>Apple IIgs character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(Rune character) => character.Value switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u2588': return 0x20;
|
||||
case '\u231B': return 0x43;
|
||||
case '\u2713': return 0x44;
|
||||
case '\u2190': return 0x48;
|
||||
case '\u2026': return 0x49;
|
||||
case '\u2193': return 0x4A;
|
||||
case '\u2191': return 0x4B;
|
||||
case '\u21B5': return 0x4D;
|
||||
case '\u2192': return 0x55;
|
||||
case '\u25C6': return 0x5B;
|
||||
case '\u0040': return 0x80;
|
||||
case '\u0041': return 0x81;
|
||||
case '\u0042': return 0x82;
|
||||
case '\u0043': return 0x83;
|
||||
case '\u0044': return 0x84;
|
||||
case '\u0045': return 0x85;
|
||||
case '\u0046': return 0x86;
|
||||
case '\u0047': return 0x87;
|
||||
case '\u0048': return 0x88;
|
||||
case '\u0049': return 0x89;
|
||||
case '\u004A': return 0x8A;
|
||||
case '\u004B': return 0x8B;
|
||||
case '\u004C': return 0x8C;
|
||||
case '\u004D': return 0x8D;
|
||||
case '\u004E': return 0x8E;
|
||||
case '\u004F': return 0x8F;
|
||||
case '\u0050': return 0x90;
|
||||
case '\u0051': return 0x91;
|
||||
case '\u0052': return 0x92;
|
||||
case '\u0053': return 0x93;
|
||||
case '\u0054': return 0x94;
|
||||
case '\u0055': return 0x95;
|
||||
case '\u0056': return 0x96;
|
||||
case '\u0057': return 0x97;
|
||||
case '\u0058': return 0x98;
|
||||
case '\u0059': return 0x99;
|
||||
case '\u005A': return 0x9A;
|
||||
case '\u005B': return 0x9B;
|
||||
case '\u005C': return 0x9C;
|
||||
case '\u005D': return 0x9D;
|
||||
case '\u005E': return 0x9E;
|
||||
case '\u005F': return 0x9F;
|
||||
case '\u0020': return 0xA0;
|
||||
case '\u0021': return 0xA1;
|
||||
case '\u0022': return 0xA2;
|
||||
case '\u0023': return 0xA3;
|
||||
case '\u0024': return 0xA4;
|
||||
case '\u2025': return 0xA5;
|
||||
case '\u0026': return 0xA6;
|
||||
case '\u0027': return 0xA7;
|
||||
case '\u0028': return 0xA8;
|
||||
case '\u0029': return 0xA9;
|
||||
case '\u002A': return 0xAA;
|
||||
case '\u002B': return 0xAB;
|
||||
case '\u002C': return 0xAC;
|
||||
case '\u002D': return 0xAD;
|
||||
case '\u002E': return 0xAE;
|
||||
case '\u002F': return 0xAF;
|
||||
case '\u0030': return 0xB0;
|
||||
case '\u0031': return 0xB1;
|
||||
case '\u0032': return 0xB2;
|
||||
case '\u0033': return 0xB3;
|
||||
case '\u0034': return 0xB4;
|
||||
case '\u0035': return 0xB5;
|
||||
case '\u0036': return 0xB6;
|
||||
case '\u0037': return 0xB7;
|
||||
case '\u0038': return 0xB8;
|
||||
case '\u0039': return 0xB9;
|
||||
case '\u003A': return 0xBA;
|
||||
case '\u003B': return 0xBB;
|
||||
case '\u003C': return 0xBC;
|
||||
case '\u003D': return 0xBD;
|
||||
case '\u003E': return 0xBE;
|
||||
case '\u003F': return 0xBF;
|
||||
case '\u0060': return 0xE0;
|
||||
case '\u0061': return 0xE1;
|
||||
case '\u0062': return 0xE2;
|
||||
case '\u0063': return 0xE3;
|
||||
case '\u0064': return 0xE4;
|
||||
case '\u0065': return 0xE5;
|
||||
case '\u0066': return 0xE6;
|
||||
case '\u0067': return 0xE7;
|
||||
case '\u0068': return 0xE8;
|
||||
case '\u0069': return 0xE9;
|
||||
case '\u006A': return 0xEA;
|
||||
case '\u006B': return 0xEB;
|
||||
case '\u006C': return 0xEC;
|
||||
case '\u006D': return 0xED;
|
||||
case '\u006E': return 0xEE;
|
||||
case '\u006F': return 0xEF;
|
||||
case '\u0070': return 0xF0;
|
||||
case '\u0071': return 0xF1;
|
||||
case '\u0072': return 0xF2;
|
||||
case '\u0073': return 0xF3;
|
||||
case '\u0074': return 0xF4;
|
||||
case '\u0075': return 0xF5;
|
||||
case '\u0076': return 0xF6;
|
||||
case '\u0077': return 0xF7;
|
||||
case '\u0078': return 0xF8;
|
||||
case '\u0079': return 0xF9;
|
||||
case '\u007A': return 0xFA;
|
||||
case '\u007B': return 0xFB;
|
||||
case '\u007C': return 0xFC;
|
||||
case '\u007D': return 0xFD;
|
||||
case '\u007E': return 0xFE;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0xBF;
|
||||
}
|
||||
}
|
||||
0x2588 => 0x20,
|
||||
0xF8FF => 0x40,
|
||||
0x1FBB0 => 0x42,
|
||||
0x231B => 0x43,
|
||||
0x2713 => 0x44,
|
||||
0x1FBB1 => 0x45,
|
||||
0x1FBB4 => 0x46,
|
||||
0x1FB81 => 0x47,
|
||||
0x2190 => 0x48,
|
||||
0x2026 => 0x49,
|
||||
0x2193 => 0x4A,
|
||||
0x2191 => 0x4B,
|
||||
0x2594 => 0x4C,
|
||||
0x21B5 => 0x4D,
|
||||
0x2589 => 0x4E,
|
||||
0x1FBB5 => 0x4F,
|
||||
0x1FBB6 => 0x50,
|
||||
0x1FBB7 => 0x51,
|
||||
0x1FBB8 => 0x52,
|
||||
0x2500 => 0x53,
|
||||
0x1FB7C => 0x54,
|
||||
0x2192 => 0x55,
|
||||
0x2592 => 0x56,
|
||||
0x1FB90 => 0x57,
|
||||
0x1FBB9 => 0x58,
|
||||
0x1FBBA => 0x59,
|
||||
0x2595 => 0x5A,
|
||||
0x25C6 => 0x5B,
|
||||
0x1FB80 => 0x5C,
|
||||
0x1FBBB => 0x5D,
|
||||
0x1FBBC => 0x5E,
|
||||
0x258F => 0x5F,
|
||||
0x0040 => 0x80,
|
||||
0x0041 => 0x81,
|
||||
0x0042 => 0x82,
|
||||
0x0043 => 0x83,
|
||||
0x0044 => 0x84,
|
||||
0x0045 => 0x85,
|
||||
0x0046 => 0x86,
|
||||
0x0047 => 0x87,
|
||||
0x0048 => 0x88,
|
||||
0x0049 => 0x89,
|
||||
0x004A => 0x8A,
|
||||
0x004B => 0x8B,
|
||||
0x004C => 0x8C,
|
||||
0x004D => 0x8D,
|
||||
0x004E => 0x8E,
|
||||
0x004F => 0x8F,
|
||||
0x0050 => 0x90,
|
||||
0x0051 => 0x91,
|
||||
0x0052 => 0x92,
|
||||
0x0053 => 0x93,
|
||||
0x0054 => 0x94,
|
||||
0x0055 => 0x95,
|
||||
0x0056 => 0x96,
|
||||
0x0057 => 0x97,
|
||||
0x0058 => 0x98,
|
||||
0x0059 => 0x99,
|
||||
0x005A => 0x9A,
|
||||
0x005B => 0x9B,
|
||||
0x005C => 0x9C,
|
||||
0x005D => 0x9D,
|
||||
0x005E => 0x9E,
|
||||
0x005F => 0x9F,
|
||||
0x0020 => 0xA0,
|
||||
0x0021 => 0xA1,
|
||||
0x0022 => 0xA2,
|
||||
0x0023 => 0xA3,
|
||||
0x0024 => 0xA4,
|
||||
0x2025 => 0xA5,
|
||||
0x0026 => 0xA6,
|
||||
0x0027 => 0xA7,
|
||||
0x0028 => 0xA8,
|
||||
0x0029 => 0xA9,
|
||||
0x002A => 0xAA,
|
||||
0x002B => 0xAB,
|
||||
0x002C => 0xAC,
|
||||
0x002D => 0xAD,
|
||||
0x002E => 0xAE,
|
||||
0x002F => 0xAF,
|
||||
0x0030 => 0xB0,
|
||||
0x0031 => 0xB1,
|
||||
0x0032 => 0xB2,
|
||||
0x0033 => 0xB3,
|
||||
0x0034 => 0xB4,
|
||||
0x0035 => 0xB5,
|
||||
0x0036 => 0xB6,
|
||||
0x0037 => 0xB7,
|
||||
0x0038 => 0xB8,
|
||||
0x0039 => 0xB9,
|
||||
0x003A => 0xBA,
|
||||
0x003B => 0xBB,
|
||||
0x003C => 0xBC,
|
||||
0x003D => 0xBD,
|
||||
0x003E => 0xBE,
|
||||
0x003F => 0xBF,
|
||||
0x0060 => 0xE0,
|
||||
0x0061 => 0xE1,
|
||||
0x0062 => 0xE2,
|
||||
0x0063 => 0xE3,
|
||||
0x0064 => 0xE4,
|
||||
0x0065 => 0xE5,
|
||||
0x0066 => 0xE6,
|
||||
0x0067 => 0xE7,
|
||||
0x0068 => 0xE8,
|
||||
0x0069 => 0xE9,
|
||||
0x006A => 0xEA,
|
||||
0x006B => 0xEB,
|
||||
0x006C => 0xEC,
|
||||
0x006D => 0xED,
|
||||
0x006E => 0xEE,
|
||||
0x006F => 0xEF,
|
||||
0x0070 => 0xF0,
|
||||
0x0071 => 0xF1,
|
||||
0x0072 => 0xF2,
|
||||
0x0073 => 0xF3,
|
||||
0x0074 => 0xF4,
|
||||
0x0075 => 0xF5,
|
||||
0x0076 => 0xF6,
|
||||
0x0077 => 0xF7,
|
||||
0x0078 => 0xF8,
|
||||
0x0079 => 0xF9,
|
||||
0x007A => 0xFA,
|
||||
0x007B => 0xFB,
|
||||
0x007C => 0xFC,
|
||||
0x007D => 0xFD,
|
||||
0x007E => 0xFE,
|
||||
_ => 0xBF
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -24,374 +24,428 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace Claunia.Encoding
|
||||
{
|
||||
/// <summary>Represents an Atari ST character encoding of Unicode characters.</summary>
|
||||
|
||||
// TODO: 0x09 => U+1F552, 0x0A => U+1F514
|
||||
public class AtariSt : SingleByteEncoding
|
||||
public class AtariSt : SingleByteEncodingWithRunes
|
||||
{
|
||||
public override string BodyName => "atarist";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Western European (Atari ST)";
|
||||
public override string HeaderName => "atarist";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "atarist";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Western European (Atari ST)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "atarist";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => false;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Atari ST to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
protected override Rune[] CharTable => new[]
|
||||
{
|
||||
// 0x00
|
||||
'\u0000', '\u21E7', '\u21E9', '\u21E8', '\u21E6', '\u274E', '\uFFFD', '\uFFFD',
|
||||
new Rune(0x0000), new Rune(0x21E7), new Rune(0x21E9), new Rune(0x21E8), new Rune(0x21E6), new Rune(0x1FBBD),
|
||||
new Rune(0x1FBBE), new Rune(0x1FBBF),
|
||||
|
||||
// 0x08
|
||||
'\u2713', '\uFFFD', '\uFFFD', '\u266A', '\u000C', '\u000D', '\uFFFD', '\uFFFD',
|
||||
new Rune(0x2713), new Rune(0x1F552), new Rune(0x1F514), new Rune(0x266A), new Rune(0x000C),
|
||||
new Rune(0x000D), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0x10
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0x1FBF0), new Rune(0x1FBF1), new Rune(0x1FBF2), new Rune(0x1FBF3), new Rune(0x1FBF4),
|
||||
new Rune(0x1FBF5), new Rune(0x1FBF6), new Rune(0x1FBF7),
|
||||
|
||||
// 0x18
|
||||
'\uFFFD', '\uFFFD', '\u0259', '\u001B', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0x1FBF8), new Rune(0x1FBF9), new Rune(0x0259), new Rune(0x001B), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0x20
|
||||
'\u0020', '\u0021', '\u0022', '\u0023', '\u0024', '\u0025', '\u0026', '\u0027',
|
||||
new Rune(0x0020), new Rune(0x0021), new Rune(0x0022), new Rune(0x0023), new Rune(0x0024), new Rune(0x0025),
|
||||
new Rune(0x0026), new Rune(0x0027),
|
||||
|
||||
// 0x28
|
||||
'\u0028', '\u0029', '\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F',
|
||||
new Rune(0x0028), new Rune(0x0029), new Rune(0x002A), new Rune(0x002B), new Rune(0x002C), new Rune(0x002D),
|
||||
new Rune(0x002E), new Rune(0x002F),
|
||||
|
||||
// 0x30
|
||||
'\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037',
|
||||
new Rune(0x0030), new Rune(0x0031), new Rune(0x0032), new Rune(0x0033), new Rune(0x0034), new Rune(0x0035),
|
||||
new Rune(0x0036), new Rune(0x0037),
|
||||
|
||||
// 0x38
|
||||
'\u0038', '\u0039', '\u003A', '\u003B', '\u003C', '\u003D', '\u003E', '\u003F',
|
||||
new Rune(0x0038), new Rune(0x0039), new Rune(0x003A), new Rune(0x003B), new Rune(0x003C), new Rune(0x003D),
|
||||
new Rune(0x003E), new Rune(0x003F),
|
||||
|
||||
// 0x40
|
||||
'\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047',
|
||||
new Rune(0x0040), new Rune(0x0041), new Rune(0x0042), new Rune(0x0043), new Rune(0x0044), new Rune(0x0045),
|
||||
new Rune(0x0046), new Rune(0x0047),
|
||||
|
||||
// 0x48
|
||||
'\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D', '\u004E', '\u004F',
|
||||
new Rune(0x0048), new Rune(0x0049), new Rune(0x004A), new Rune(0x004B), new Rune(0x004C), new Rune(0x004D),
|
||||
new Rune(0x004E), new Rune(0x004F),
|
||||
|
||||
// 0x50
|
||||
'\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057',
|
||||
new Rune(0x0050), new Rune(0x0051), new Rune(0x0052), new Rune(0x0053), new Rune(0x0054), new Rune(0x0055),
|
||||
new Rune(0x0056), new Rune(0x0057),
|
||||
|
||||
// 0x58
|
||||
'\u0058', '\u0059', '\u005A', '\u005B', '\u005C', '\u005D', '\u005E', '\u005F',
|
||||
new Rune(0x0058), new Rune(0x0059), new Rune(0x005A), new Rune(0x005B), new Rune(0x005C), new Rune(0x005D),
|
||||
new Rune(0x005E), new Rune(0x005F),
|
||||
|
||||
// 0x60
|
||||
'\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065', '\u0066', '\u0067',
|
||||
new Rune(0x0060), new Rune(0x0061), new Rune(0x0062), new Rune(0x0063), new Rune(0x0064), new Rune(0x0065),
|
||||
new Rune(0x0066), new Rune(0x0067),
|
||||
|
||||
// 0x68
|
||||
'\u0068', '\u0069', '\u006A', '\u006B', '\u006C', '\u006D', '\u006E', '\u006F',
|
||||
new Rune(0x0068), new Rune(0x0069), new Rune(0x006A), new Rune(0x006B), new Rune(0x006C), new Rune(0x006D),
|
||||
new Rune(0x006E), new Rune(0x006F),
|
||||
|
||||
// 0x70
|
||||
'\u0070', '\u0071', '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077',
|
||||
new Rune(0x0070), new Rune(0x0071), new Rune(0x0072), new Rune(0x0073), new Rune(0x0074), new Rune(0x0075),
|
||||
new Rune(0x0076), new Rune(0x0077),
|
||||
|
||||
// 0x78
|
||||
'\u0078', '\u0079', '\u007A', '\u007B', '\u007C', '\u007D', '\u007E', '\u2302',
|
||||
new Rune(0x0078), new Rune(0x0079), new Rune(0x007A), new Rune(0x007B), new Rune(0x007C), new Rune(0x007D),
|
||||
new Rune(0x007E), new Rune(0x2302),
|
||||
|
||||
// 0x80
|
||||
'\u00C7', '\u00FC', '\u00E9', '\u00E2', '\u00E4', '\u00E0', '\u00E5', '\u00E7',
|
||||
new Rune(0x00C7), new Rune(0x00FC), new Rune(0x00E9), new Rune(0x00E2), new Rune(0x00E4), new Rune(0x00E0),
|
||||
new Rune(0x00E5), new Rune(0x00E7),
|
||||
|
||||
// 0x88
|
||||
'\u00EA', '\u00EB', '\u00E8', '\u00EF', '\u00EE', '\u00EC', '\u00C4', '\u00C5',
|
||||
new Rune(0x00EA), new Rune(0x00EB), new Rune(0x00E8), new Rune(0x00EF), new Rune(0x00EE), new Rune(0x00EC),
|
||||
new Rune(0x00C4), new Rune(0x00C5),
|
||||
|
||||
// 0x90
|
||||
'\u00C9', '\u00E6', '\u00C6', '\u00F4', '\u00F6', '\u00F2', '\u00FB', '\u00F9',
|
||||
new Rune(0x00C9), new Rune(0x00E6), new Rune(0x00C6), new Rune(0x00F4), new Rune(0x00F6), new Rune(0x00F2),
|
||||
new Rune(0x00FB), new Rune(0x00F9),
|
||||
|
||||
// 0x98
|
||||
'\u00FF', '\u00D6', '\u00DC', '\u00A2', '\u00A3', '\u00A5', '\u00DF', '\u0192',
|
||||
new Rune(0x00FF), new Rune(0x00D6), new Rune(0x00DC), new Rune(0x00A2), new Rune(0x00A3), new Rune(0x00A5),
|
||||
new Rune(0x00DF), new Rune(0x0192),
|
||||
|
||||
// 0xA0
|
||||
'\u00E1', '\u00ED', '\u00F3', '\u00FA', '\u00F1', '\u00D1', '\u00AA', '\u00BA',
|
||||
new Rune(0x00E1), new Rune(0x00ED), new Rune(0x00F3), new Rune(0x00FA), new Rune(0x00F1), new Rune(0x00D1),
|
||||
new Rune(0x00AA), new Rune(0x00BA),
|
||||
|
||||
// 0xA8
|
||||
'\u00BF', '\u2310', '\u00AC', '\u00BD', '\u00BC', '\u00A1', '\u00AB', '\u00BB',
|
||||
new Rune(0x00BF), new Rune(0x2310), new Rune(0x00AC), new Rune(0x00BD), new Rune(0x00BC), new Rune(0x00A1),
|
||||
new Rune(0x00AB), new Rune(0x00BB),
|
||||
|
||||
// 0xB0
|
||||
'\u00E3', '\u00F5', '\u00D8', '\u00F8', '\u0153', '\u0152', '\u00C0', '\u00C3',
|
||||
new Rune(0x00E3), new Rune(0x00F5), new Rune(0x00D8), new Rune(0x00F8), new Rune(0x0153), new Rune(0x0152),
|
||||
new Rune(0x00C0), new Rune(0x00C3),
|
||||
|
||||
// 0xB8
|
||||
'\u00D5', '\u00A8', '\u00B4', '\u2020', '\u00B6', '\u00A9', '\u00AE', '\u2122',
|
||||
new Rune(0x00D5), new Rune(0x00A8), new Rune(0x00B4), new Rune(0x2020), new Rune(0x00B6), new Rune(0x00A9),
|
||||
new Rune(0x00AE), new Rune(0x2122),
|
||||
|
||||
// 0xC0
|
||||
'\u0133', '\u0132', '\u05D0', '\u05D1', '\u05D2', '\u05D3', '\u05D4', '\u05D5',
|
||||
new Rune(0x0133), new Rune(0x0132), new Rune(0x05D0), new Rune(0x05D1), new Rune(0x05D2), new Rune(0x05D3),
|
||||
new Rune(0x05D4), new Rune(0x05D5),
|
||||
|
||||
// 0xC8
|
||||
'\u05D6', '\u05D7', '\u05D8', '\u05D9', '\u05DB', '\u05DC', '\u05DE', '\u05E0',
|
||||
new Rune(0x05D6), new Rune(0x05D7), new Rune(0x05D8), new Rune(0x05D9), new Rune(0x05DB), new Rune(0x05DC),
|
||||
new Rune(0x05DE), new Rune(0x05E0),
|
||||
|
||||
// 0xD0
|
||||
'\u05E1', '\u05E2', '\u05E4', '\u05E6', '\u05E7', '\u05E8', '\u05E9', '\u05EA',
|
||||
new Rune(0x05E1), new Rune(0x05E2), new Rune(0x05E4), new Rune(0x05E6), new Rune(0x05E7), new Rune(0x05E8),
|
||||
new Rune(0x05E9), new Rune(0x05EA),
|
||||
|
||||
// 0xD8
|
||||
'\u05DF', '\u05DA', '\u05DD', '\u05E3', '\u05E5', '\u00A7', '\u2227', '\u221E',
|
||||
new Rune(0x05DF), new Rune(0x05DA), new Rune(0x05DD), new Rune(0x05E3), new Rune(0x05E5), new Rune(0x00A7),
|
||||
new Rune(0x2227), new Rune(0x221E),
|
||||
|
||||
// 0xE0
|
||||
'\u03B1', '\u03B2', '\u0393', '\u03C0', '\u03A3', '\u03C3', '\u00B5', '\u03C4',
|
||||
new Rune(0x03B1), new Rune(0x03B2), new Rune(0x0393), new Rune(0x03C0), new Rune(0x03A3), new Rune(0x03C3),
|
||||
new Rune(0x00B5), new Rune(0x03C4),
|
||||
|
||||
// 0xE8
|
||||
'\u03A6', '\u0398', '\u03A9', '\u03B4', '\u222E', '\u03D5', '\u2208', '\u2229',
|
||||
new Rune(0x03A6), new Rune(0x0398), new Rune(0x03A9), new Rune(0x03B4), new Rune(0x222E), new Rune(0x03D5),
|
||||
new Rune(0x2208), new Rune(0x2229),
|
||||
|
||||
// 0xF0
|
||||
'\u2261', '\u00B1', '\u2265', '\u2264', '\u2320', '\u2321', '\u00F7', '\u2248',
|
||||
new Rune(0x2261), new Rune(0x00B1), new Rune(0x2265), new Rune(0x2264), new Rune(0x2320), new Rune(0x2321),
|
||||
new Rune(0x00F7), new Rune(0x2248),
|
||||
|
||||
// 0xF8
|
||||
'\u00B0', '\u2219', '\u00B7', '\u221A', '\u207F', '\u00B2', '\u00B3', '\u00AF'
|
||||
new Rune(0x00B0), new Rune(0x2219), new Rune(0x00B7), new Rune(0x221A), new Rune(0x207F), new Rune(0x00B2),
|
||||
new Rune(0x00B3), new Rune(0x00AF)
|
||||
};
|
||||
|
||||
/// <summary>Converts a Unicode character to an Atari ST character</summary>
|
||||
/// <returns>Atari ST character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(Rune character) => character.Value switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u21E7': return 0x01;
|
||||
case '\u21E9': return 0x02;
|
||||
case '\u21E8': return 0x03;
|
||||
case '\u21E6': return 0x04;
|
||||
case '\u274E': return 0x05;
|
||||
case '\u2713': return 0x08;
|
||||
case '\u266A': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u0259': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u2302': return 0x7F;
|
||||
case '\u00C7': return 0x80;
|
||||
case '\u00FC': return 0x81;
|
||||
case '\u00E9': return 0x82;
|
||||
case '\u00E2': return 0x83;
|
||||
case '\u00E4': return 0x84;
|
||||
case '\u00E0': return 0x85;
|
||||
case '\u00E5': return 0x86;
|
||||
case '\u00E7': return 0x87;
|
||||
case '\u00EA': return 0x88;
|
||||
case '\u00EB': return 0x89;
|
||||
case '\u00E8': return 0x8A;
|
||||
case '\u00EF': return 0x8B;
|
||||
case '\u00EE': return 0x8C;
|
||||
case '\u00EC': return 0x8D;
|
||||
case '\u00C4': return 0x8E;
|
||||
case '\u00C5': return 0x8F;
|
||||
case '\u00C9': return 0x90;
|
||||
case '\u00E6': return 0x91;
|
||||
case '\u00C6': return 0x92;
|
||||
case '\u00F4': return 0x93;
|
||||
case '\u00F6': return 0x94;
|
||||
case '\u00F2': return 0x95;
|
||||
case '\u00FB': return 0x96;
|
||||
case '\u00F9': return 0x97;
|
||||
case '\u00FF': return 0x98;
|
||||
case '\u00D6': return 0x99;
|
||||
case '\u00DC': return 0x9A;
|
||||
case '\u00A2': return 0x9B;
|
||||
case '\u00A3': return 0x9C;
|
||||
case '\u00A5': return 0x9D;
|
||||
case '\u00DF': return 0x9E;
|
||||
case '\u0192': return 0x9F;
|
||||
case '\u00E1': return 0xA0;
|
||||
case '\u00ED': return 0xA1;
|
||||
case '\u00F3': return 0xA2;
|
||||
case '\u00FA': return 0xA3;
|
||||
case '\u00F1': return 0xA4;
|
||||
case '\u00D1': return 0xA5;
|
||||
case '\u00AA': return 0xA6;
|
||||
case '\u00BA': return 0xA7;
|
||||
case '\u00BF': return 0xA8;
|
||||
case '\u2310': return 0xA9;
|
||||
case '\u00AC': return 0xAA;
|
||||
case '\u00BD': return 0xAB;
|
||||
case '\u00BC': return 0xAC;
|
||||
case '\u00A1': return 0xAD;
|
||||
case '\u00AB': return 0xAE;
|
||||
case '\u00BB': return 0xAF;
|
||||
case '\u00E3': return 0xB0;
|
||||
case '\u00F5': return 0xB1;
|
||||
case '\u00D8': return 0xB2;
|
||||
case '\u00F8': return 0xB3;
|
||||
case '\u0153': return 0xB4;
|
||||
case '\u0152': return 0xB5;
|
||||
case '\u00C0': return 0xB6;
|
||||
case '\u00C3': return 0xB7;
|
||||
case '\u00D5': return 0xB8;
|
||||
case '\u00A8': return 0xB9;
|
||||
case '\u00B4': return 0xBA;
|
||||
case '\u2020': return 0xBB;
|
||||
case '\u00B6': return 0xBC;
|
||||
case '\u00A9': return 0xBD;
|
||||
case '\u00AE': return 0xBE;
|
||||
case '\u2122': return 0xBF;
|
||||
case '\u0133': return 0xC0;
|
||||
case '\u0132': return 0xC1;
|
||||
case '\u05D0': return 0xC2;
|
||||
case '\u05D1': return 0xC3;
|
||||
case '\u05D2': return 0xC4;
|
||||
case '\u05D3': return 0xC5;
|
||||
case '\u05D4': return 0xC6;
|
||||
case '\u05D5': return 0xC7;
|
||||
case '\u05D6': return 0xC8;
|
||||
case '\u05D7': return 0xC9;
|
||||
case '\u05D8': return 0xCA;
|
||||
case '\u05D9': return 0xCB;
|
||||
case '\u05DB': return 0xCC;
|
||||
case '\u05DC': return 0xCD;
|
||||
case '\u05DE': return 0xCE;
|
||||
case '\u05E0': return 0xCF;
|
||||
case '\u05E1': return 0xD0;
|
||||
case '\u05E2': return 0xD1;
|
||||
case '\u05E4': return 0xD2;
|
||||
case '\u05E6': return 0xD3;
|
||||
case '\u05E7': return 0xD4;
|
||||
case '\u05E8': return 0xD5;
|
||||
case '\u05E9': return 0xD6;
|
||||
case '\u05EA': return 0xD7;
|
||||
case '\u05DF': return 0xD8;
|
||||
case '\u05DA': return 0xD9;
|
||||
case '\u05DD': return 0xDA;
|
||||
case '\u05E3': return 0xDB;
|
||||
case '\u05E5': return 0xDC;
|
||||
case '\u00A7': return 0xDD;
|
||||
case '\u2227': return 0xDE;
|
||||
case '\u221E': return 0xDF;
|
||||
case '\u03B1': return 0xE0;
|
||||
case '\u03B2': return 0xE1;
|
||||
case '\u0393': return 0xE2;
|
||||
case '\u03C0': return 0xE3;
|
||||
case '\u03A3': return 0xE4;
|
||||
case '\u03C3': return 0xE5;
|
||||
case '\u00B5': return 0xE6;
|
||||
case '\u03C4': return 0xE7;
|
||||
case '\u03A6': return 0xE8;
|
||||
case '\u0398': return 0xE9;
|
||||
case '\u03A9': return 0xEA;
|
||||
case '\u03B4': return 0xEB;
|
||||
case '\u222E': return 0xEC;
|
||||
case '\u03D5': return 0xED;
|
||||
case '\u2208': return 0xEE;
|
||||
case '\u2229': return 0xEF;
|
||||
case '\u2261': return 0xF0;
|
||||
case '\u00B1': return 0xF1;
|
||||
case '\u2265': return 0xF2;
|
||||
case '\u2264': return 0xF3;
|
||||
case '\u2320': return 0xF4;
|
||||
case '\u2321': return 0xF5;
|
||||
case '\u00F7': return 0xF6;
|
||||
case '\u2248': return 0xF7;
|
||||
case '\u00B0': return 0xF8;
|
||||
case '\u2219': return 0xF9;
|
||||
case '\u00B7': return 0xFA;
|
||||
case '\u221A': return 0xFB;
|
||||
case '\u207F': return 0xFC;
|
||||
case '\u00B2': return 0xFD;
|
||||
case '\u00B3': return 0xFE;
|
||||
case '\u00AF': return 0xFF;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
0x0000 => 0x00,
|
||||
0x21E7 => 0x01,
|
||||
0x21E9 => 0x02,
|
||||
0x21E8 => 0x03,
|
||||
0x21E6 => 0x04,
|
||||
0x274E => 0x05,
|
||||
0x1FBBD => 0x05,
|
||||
0x1FBBE => 0x06,
|
||||
0x1FBBF => 0x07,
|
||||
0x2713 => 0x08,
|
||||
0x1F552 => 0x09,
|
||||
0x1F514 => 0x0A,
|
||||
0x266A => 0x0B,
|
||||
0x000C => 0x0C,
|
||||
0x000D => 0x0D,
|
||||
0x1FBF0 => 0x10,
|
||||
0x1FBF1 => 0x11,
|
||||
0x1FBF2 => 0x12,
|
||||
0x1FBF3 => 0x13,
|
||||
0x1FBF4 => 0x14,
|
||||
0x1FBF5 => 0x15,
|
||||
0x1FBF6 => 0x16,
|
||||
0x1FBF7 => 0x17,
|
||||
0x1FBF8 => 0x18,
|
||||
0x1FBF9 => 0x19,
|
||||
0x0259 => 0x1A,
|
||||
0x001B => 0x1B,
|
||||
0x0020 => 0x20,
|
||||
0x0021 => 0x21,
|
||||
0x0022 => 0x22,
|
||||
0x0023 => 0x23,
|
||||
0x0024 => 0x24,
|
||||
0x0025 => 0x25,
|
||||
0x0026 => 0x26,
|
||||
0x0027 => 0x27,
|
||||
0x0028 => 0x28,
|
||||
0x0029 => 0x29,
|
||||
0x002A => 0x2A,
|
||||
0x002B => 0x2B,
|
||||
0x002C => 0x2C,
|
||||
0x002D => 0x2D,
|
||||
0x002E => 0x2E,
|
||||
0x002F => 0x2F,
|
||||
0x0030 => 0x30,
|
||||
0x0031 => 0x31,
|
||||
0x0032 => 0x32,
|
||||
0x0033 => 0x33,
|
||||
0x0034 => 0x34,
|
||||
0x0035 => 0x35,
|
||||
0x0036 => 0x36,
|
||||
0x0037 => 0x37,
|
||||
0x0038 => 0x38,
|
||||
0x0039 => 0x39,
|
||||
0x003A => 0x3A,
|
||||
0x003B => 0x3B,
|
||||
0x003C => 0x3C,
|
||||
0x003D => 0x3D,
|
||||
0x003E => 0x3E,
|
||||
0x003F => 0x3F,
|
||||
0x0040 => 0x40,
|
||||
0x0041 => 0x41,
|
||||
0x0042 => 0x42,
|
||||
0x0043 => 0x43,
|
||||
0x0044 => 0x44,
|
||||
0x0045 => 0x45,
|
||||
0x0046 => 0x46,
|
||||
0x0047 => 0x47,
|
||||
0x0048 => 0x48,
|
||||
0x0049 => 0x49,
|
||||
0x004A => 0x4A,
|
||||
0x004B => 0x4B,
|
||||
0x004C => 0x4C,
|
||||
0x004D => 0x4D,
|
||||
0x004E => 0x4E,
|
||||
0x004F => 0x4F,
|
||||
0x0050 => 0x50,
|
||||
0x0051 => 0x51,
|
||||
0x0052 => 0x52,
|
||||
0x0053 => 0x53,
|
||||
0x0054 => 0x54,
|
||||
0x0055 => 0x55,
|
||||
0x0056 => 0x56,
|
||||
0x0057 => 0x57,
|
||||
0x0058 => 0x58,
|
||||
0x0059 => 0x59,
|
||||
0x005A => 0x5A,
|
||||
0x005B => 0x5B,
|
||||
0x005C => 0x5C,
|
||||
0x005D => 0x5D,
|
||||
0x005E => 0x5E,
|
||||
0x005F => 0x5F,
|
||||
0x0060 => 0x60,
|
||||
0x0061 => 0x61,
|
||||
0x0062 => 0x62,
|
||||
0x0063 => 0x63,
|
||||
0x0064 => 0x64,
|
||||
0x0065 => 0x65,
|
||||
0x0066 => 0x66,
|
||||
0x0067 => 0x67,
|
||||
0x0068 => 0x68,
|
||||
0x0069 => 0x69,
|
||||
0x006A => 0x6A,
|
||||
0x006B => 0x6B,
|
||||
0x006C => 0x6C,
|
||||
0x006D => 0x6D,
|
||||
0x006E => 0x6E,
|
||||
0x006F => 0x6F,
|
||||
0x0070 => 0x70,
|
||||
0x0071 => 0x71,
|
||||
0x0072 => 0x72,
|
||||
0x0073 => 0x73,
|
||||
0x0074 => 0x74,
|
||||
0x0075 => 0x75,
|
||||
0x0076 => 0x76,
|
||||
0x0077 => 0x77,
|
||||
0x0078 => 0x78,
|
||||
0x0079 => 0x79,
|
||||
0x007A => 0x7A,
|
||||
0x007B => 0x7B,
|
||||
0x007C => 0x7C,
|
||||
0x007D => 0x7D,
|
||||
0x007E => 0x7E,
|
||||
0x2302 => 0x7F,
|
||||
0x00C7 => 0x80,
|
||||
0x00FC => 0x81,
|
||||
0x00E9 => 0x82,
|
||||
0x00E2 => 0x83,
|
||||
0x00E4 => 0x84,
|
||||
0x00E0 => 0x85,
|
||||
0x00E5 => 0x86,
|
||||
0x00E7 => 0x87,
|
||||
0x00EA => 0x88,
|
||||
0x00EB => 0x89,
|
||||
0x00E8 => 0x8A,
|
||||
0x00EF => 0x8B,
|
||||
0x00EE => 0x8C,
|
||||
0x00EC => 0x8D,
|
||||
0x00C4 => 0x8E,
|
||||
0x00C5 => 0x8F,
|
||||
0x00C9 => 0x90,
|
||||
0x00E6 => 0x91,
|
||||
0x00C6 => 0x92,
|
||||
0x00F4 => 0x93,
|
||||
0x00F6 => 0x94,
|
||||
0x00F2 => 0x95,
|
||||
0x00FB => 0x96,
|
||||
0x00F9 => 0x97,
|
||||
0x00FF => 0x98,
|
||||
0x00D6 => 0x99,
|
||||
0x00DC => 0x9A,
|
||||
0x00A2 => 0x9B,
|
||||
0x00A3 => 0x9C,
|
||||
0x00A5 => 0x9D,
|
||||
0x00DF => 0x9E,
|
||||
0x0192 => 0x9F,
|
||||
0x00E1 => 0xA0,
|
||||
0x00ED => 0xA1,
|
||||
0x00F3 => 0xA2,
|
||||
0x00FA => 0xA3,
|
||||
0x00F1 => 0xA4,
|
||||
0x00D1 => 0xA5,
|
||||
0x00AA => 0xA6,
|
||||
0x00BA => 0xA7,
|
||||
0x00BF => 0xA8,
|
||||
0x2310 => 0xA9,
|
||||
0x00AC => 0xAA,
|
||||
0x00BD => 0xAB,
|
||||
0x00BC => 0xAC,
|
||||
0x00A1 => 0xAD,
|
||||
0x00AB => 0xAE,
|
||||
0x00BB => 0xAF,
|
||||
0x00E3 => 0xB0,
|
||||
0x00F5 => 0xB1,
|
||||
0x00D8 => 0xB2,
|
||||
0x00F8 => 0xB3,
|
||||
0x0153 => 0xB4,
|
||||
0x0152 => 0xB5,
|
||||
0x00C0 => 0xB6,
|
||||
0x00C3 => 0xB7,
|
||||
0x00D5 => 0xB8,
|
||||
0x00A8 => 0xB9,
|
||||
0x00B4 => 0xBA,
|
||||
0x2020 => 0xBB,
|
||||
0x00B6 => 0xBC,
|
||||
0x00A9 => 0xBD,
|
||||
0x00AE => 0xBE,
|
||||
0x2122 => 0xBF,
|
||||
0x0133 => 0xC0,
|
||||
0x0132 => 0xC1,
|
||||
0x05D0 => 0xC2,
|
||||
0x05D1 => 0xC3,
|
||||
0x05D2 => 0xC4,
|
||||
0x05D3 => 0xC5,
|
||||
0x05D4 => 0xC6,
|
||||
0x05D5 => 0xC7,
|
||||
0x05D6 => 0xC8,
|
||||
0x05D7 => 0xC9,
|
||||
0x05D8 => 0xCA,
|
||||
0x05D9 => 0xCB,
|
||||
0x05DB => 0xCC,
|
||||
0x05DC => 0xCD,
|
||||
0x05DE => 0xCE,
|
||||
0x05E0 => 0xCF,
|
||||
0x05E1 => 0xD0,
|
||||
0x05E2 => 0xD1,
|
||||
0x05E4 => 0xD2,
|
||||
0x05E6 => 0xD3,
|
||||
0x05E7 => 0xD4,
|
||||
0x05E8 => 0xD5,
|
||||
0x05E9 => 0xD6,
|
||||
0x05EA => 0xD7,
|
||||
0x05DF => 0xD8,
|
||||
0x05DA => 0xD9,
|
||||
0x05DD => 0xDA,
|
||||
0x05E3 => 0xDB,
|
||||
0x05E5 => 0xDC,
|
||||
0x00A7 => 0xDD,
|
||||
0x2227 => 0xDE,
|
||||
0x221E => 0xDF,
|
||||
0x03B1 => 0xE0,
|
||||
0x03B2 => 0xE1,
|
||||
0x0393 => 0xE2,
|
||||
0x03C0 => 0xE3,
|
||||
0x03A3 => 0xE4,
|
||||
0x03C3 => 0xE5,
|
||||
0x00B5 => 0xE6,
|
||||
0x03C4 => 0xE7,
|
||||
0x03A6 => 0xE8,
|
||||
0x0398 => 0xE9,
|
||||
0x03A9 => 0xEA,
|
||||
0x03B4 => 0xEB,
|
||||
0x222E => 0xEC,
|
||||
0x03D5 => 0xED,
|
||||
0x2208 => 0xEE,
|
||||
0x2229 => 0xEF,
|
||||
0x2261 => 0xF0,
|
||||
0x00B1 => 0xF1,
|
||||
0x2265 => 0xF2,
|
||||
0x2264 => 0xF3,
|
||||
0x2320 => 0xF4,
|
||||
0x2321 => 0xF5,
|
||||
0x00F7 => 0xF6,
|
||||
0x2248 => 0xF7,
|
||||
0x00B0 => 0xF8,
|
||||
0x2219 => 0xF9,
|
||||
0x00B7 => 0xFA,
|
||||
0x221A => 0xFB,
|
||||
0x207F => 0xFC,
|
||||
0x00B2 => 0xFD,
|
||||
0x00B3 => 0xFE,
|
||||
0x00AF => 0xFF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -16,10 +16,10 @@
|
||||
<Title>Claunia.Encoding</Title>
|
||||
<Description>Library to provide codepage conversion to and from archaic and old computer systems and Unicode.</Description>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<ReleaseVersion>1.8</ReleaseVersion>
|
||||
<PackageReleaseNotes>Support .NET Core 3.1 and .NET 5.0.</PackageReleaseNotes>
|
||||
<ReleaseVersion>1.9</ReleaseVersion>
|
||||
<PackageReleaseNotes>Updated all codepages to include symbols defined as of Unicode 13.0</PackageReleaseNotes>
|
||||
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<VersionPrefix>1.8</VersionPrefix>
|
||||
<VersionPrefix>1.9</VersionPrefix>
|
||||
<Company>Claunia.com</Company>
|
||||
<Copyright>© 2016-2021 Natalia Portillo</Copyright>
|
||||
<PackageProjectUrl>https://www.github.com/claunia/Claunia.Encoding</PackageProjectUrl>
|
||||
|
||||
@@ -24,381 +24,425 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace Claunia.Encoding
|
||||
{
|
||||
/// <summary>Represents a GEM character encoding of Unicode characters.</summary>
|
||||
public class Gem : SingleByteEncoding
|
||||
public class Gem : SingleByteEncodingWithRunes
|
||||
{
|
||||
public override string BodyName => "gem";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Western European (GEM)";
|
||||
public override string HeaderName => "gem";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "gem";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Western European (GEM)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "gem";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => false;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The GEM to Unicode character map. Pending: 0x09 => 0x0001F552, 0x0A => 0x0001F514</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
/// <summary>The GEM to Unicode character map.</summary>
|
||||
protected override Rune[] CharTable => new[]
|
||||
{
|
||||
// 0x00
|
||||
'\u0000', '\u21E7', '\u21E9', '\u21E8', '\u21E6', '\u25FC', '\uFFFD', '\u25C6',
|
||||
new Rune(0x0000), new Rune(0x21E7), new Rune(0x21E9), new Rune(0x21E8), new Rune(0x21E6), new Rune(0x25FC),
|
||||
new Rune(0x1F5D7), new Rune(0x25C6),
|
||||
|
||||
// 0x08
|
||||
'\u2713', '\uFFFD', '\uFFFD', '\u266A', '\u25B4', '\u25BE', '\u25B8', '\u25C2',
|
||||
new Rune(0x2713), new Rune(0x1F552), new Rune(0x1F514), new Rune(0x266A), new Rune(0x25B4),
|
||||
new Rune(0x25BE), new Rune(0x25B8), new Rune(0x25C2),
|
||||
|
||||
// 0x10
|
||||
'\u25BA', '\u25C4', '\u29D3', '\u2582', '\u00B6', '\u00A7', '\u2195', '\u21A8',
|
||||
new Rune(0x25BA), new Rune(0x25C4), new Rune(0x29D3), new Rune(0x2582), new Rune(0x00B6), new Rune(0x00A7),
|
||||
new Rune(0x2195), new Rune(0x21A8),
|
||||
|
||||
// 0x18
|
||||
'\u2191', '\u2193', '\u2192', '\u2190', '\u221F', '\u2194', '\u25B2', '\u25BC',
|
||||
new Rune(0x2191), new Rune(0x2193), new Rune(0x2192), new Rune(0x2190), new Rune(0x221F), new Rune(0x2194),
|
||||
new Rune(0x25B2), new Rune(0x25BC),
|
||||
|
||||
// 0x20
|
||||
'\u0020', '\u0021', '\u0022', '\u0023', '\u0024', '\u0025', '\u0026', '\u0027',
|
||||
new Rune(0x0020), new Rune(0x0021), new Rune(0x0022), new Rune(0x0023), new Rune(0x0024), new Rune(0x0025),
|
||||
new Rune(0x0026), new Rune(0x0027),
|
||||
|
||||
// 0x28
|
||||
'\u0028', '\u0029', '\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F',
|
||||
new Rune(0x0028), new Rune(0x0029), new Rune(0x002A), new Rune(0x002B), new Rune(0x002C), new Rune(0x002D),
|
||||
new Rune(0x002E), new Rune(0x002F),
|
||||
|
||||
// 0x30
|
||||
'\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037',
|
||||
new Rune(0x0030), new Rune(0x0031), new Rune(0x0032), new Rune(0x0033), new Rune(0x0034), new Rune(0x0035),
|
||||
new Rune(0x0036), new Rune(0x0037),
|
||||
|
||||
// 0x38
|
||||
'\u0038', '\u0039', '\u003A', '\u003B', '\u003C', '\u003D', '\u003E', '\u003F',
|
||||
new Rune(0x0038), new Rune(0x0039), new Rune(0x003A), new Rune(0x003B), new Rune(0x003C), new Rune(0x003D),
|
||||
new Rune(0x003E), new Rune(0x003F),
|
||||
|
||||
// 0x40
|
||||
'\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047',
|
||||
new Rune(0x0040), new Rune(0x0041), new Rune(0x0042), new Rune(0x0043), new Rune(0x0044), new Rune(0x0045),
|
||||
new Rune(0x0046), new Rune(0x0047),
|
||||
|
||||
// 0x48
|
||||
'\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D', '\u004E', '\u004F',
|
||||
new Rune(0x0048), new Rune(0x0049), new Rune(0x004A), new Rune(0x004B), new Rune(0x004C), new Rune(0x004D),
|
||||
new Rune(0x004E), new Rune(0x004F),
|
||||
|
||||
// 0x50
|
||||
'\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057',
|
||||
new Rune(0x0050), new Rune(0x0051), new Rune(0x0052), new Rune(0x0053), new Rune(0x0054), new Rune(0x0055),
|
||||
new Rune(0x0056), new Rune(0x0057),
|
||||
|
||||
// 0x58
|
||||
'\u0058', '\u0059', '\u005A', '\u005B', '\u005C', '\u005D', '\u005E', '\u005F',
|
||||
new Rune(0x0058), new Rune(0x0059), new Rune(0x005A), new Rune(0x005B), new Rune(0x005C), new Rune(0x005D),
|
||||
new Rune(0x005E), new Rune(0x005F),
|
||||
|
||||
// 0x60
|
||||
'\u0060', '\u0061', '\u0062', '\u0063', '\u0064', '\u0065', '\u0066', '\u0067',
|
||||
new Rune(0x0060), new Rune(0x0061), new Rune(0x0062), new Rune(0x0063), new Rune(0x0064), new Rune(0x0065),
|
||||
new Rune(0x0066), new Rune(0x0067),
|
||||
|
||||
// 0x68
|
||||
'\u0068', '\u0069', '\u006A', '\u006B', '\u006C', '\u006D', '\u006E', '\u006F',
|
||||
new Rune(0x0068), new Rune(0x0069), new Rune(0x006A), new Rune(0x006B), new Rune(0x006C), new Rune(0x006D),
|
||||
new Rune(0x006E), new Rune(0x006F),
|
||||
|
||||
// 0x70
|
||||
'\u0070', '\u0071', '\u0072', '\u0073', '\u0074', '\u0075', '\u0076', '\u0077',
|
||||
new Rune(0x0070), new Rune(0x0071), new Rune(0x0072), new Rune(0x0073), new Rune(0x0074), new Rune(0x0075),
|
||||
new Rune(0x0076), new Rune(0x0077),
|
||||
|
||||
// 0x78
|
||||
'\u0078', '\u0079', '\u007A', '\u007B', '\u007C', '\u007D', '\u007E', '\u2302',
|
||||
new Rune(0x0078), new Rune(0x0079), new Rune(0x007A), new Rune(0x007B), new Rune(0x007C), new Rune(0x007D),
|
||||
new Rune(0x007E), new Rune(0x2302),
|
||||
|
||||
// 0x80
|
||||
'\u00C7', '\u00FC', '\u00E9', '\u00E2', '\u00E4', '\u00E0', '\u00E5', '\u00E7',
|
||||
new Rune(0x00C7), new Rune(0x00FC), new Rune(0x00E9), new Rune(0x00E2), new Rune(0x00E4), new Rune(0x00E0),
|
||||
new Rune(0x00E5), new Rune(0x00E7),
|
||||
|
||||
// 0x88
|
||||
'\u00EA', '\u00EB', '\u00E8', '\u00EF', '\u00EE', '\u00EC', '\u00C4', '\u00C5',
|
||||
new Rune(0x00EA), new Rune(0x00EB), new Rune(0x00E8), new Rune(0x00EF), new Rune(0x00EE), new Rune(0x00EC),
|
||||
new Rune(0x00C4), new Rune(0x00C5),
|
||||
|
||||
// 0x90
|
||||
'\u00C9', '\u00E6', '\u00C6', '\u00F4', '\u00F6', '\u00F2', '\u00FB', '\u00F9',
|
||||
new Rune(0x00C9), new Rune(0x00E6), new Rune(0x00C6), new Rune(0x00F4), new Rune(0x00F6), new Rune(0x00F2),
|
||||
new Rune(0x00FB), new Rune(0x00F9),
|
||||
|
||||
// 0x98
|
||||
'\u00FF', '\u00D6', '\u00DC', '\u00FB', '\u00A3', '\u00D8', '\u00A4', '\u0192',
|
||||
new Rune(0x00FF), new Rune(0x00D6), new Rune(0x00DC), new Rune(0x00FB), new Rune(0x00A3), new Rune(0x00D8),
|
||||
new Rune(0x00A4), new Rune(0x0192),
|
||||
|
||||
// 0xA0
|
||||
'\u00E1', '\u00ED', '\u00F3', '\u00FA', '\u00F1', '\u00D1', '\u00AA', '\u00BA',
|
||||
new Rune(0x00E1), new Rune(0x00ED), new Rune(0x00F3), new Rune(0x00FA), new Rune(0x00F1), new Rune(0x00D1),
|
||||
new Rune(0x00AA), new Rune(0x00BA),
|
||||
|
||||
// 0xA8
|
||||
'\u00BF', '\u201C', '\u201D', '\u2039', '\u203A', '\u00A1', '\u00AB', '\u00BB',
|
||||
new Rune(0x00BF), new Rune(0x201C), new Rune(0x201D), new Rune(0x2039), new Rune(0x203A), new Rune(0x00A1),
|
||||
new Rune(0x00AB), new Rune(0x00BB),
|
||||
|
||||
// 0xB0
|
||||
'\u00E3', '\u00F5', '\u00A5', '\u00A2', '\u0153', '\u0152', '\u00C0', '\u00C3',
|
||||
new Rune(0x00E3), new Rune(0x00F5), new Rune(0x00A5), new Rune(0x00A2), new Rune(0x0153), new Rune(0x0152),
|
||||
new Rune(0x00C0), new Rune(0x00C3),
|
||||
|
||||
// 0xB8
|
||||
'\u00D5', '\u00A7', '\u2021', '\u2020', '\u00B6', '\u00A9', '\u00AE', '\u2122',
|
||||
new Rune(0x00D5), new Rune(0x00A7), new Rune(0x2021), new Rune(0x2020), new Rune(0x00B6), new Rune(0x00A9),
|
||||
new Rune(0x00AE), new Rune(0x2122),
|
||||
|
||||
// 0xC0
|
||||
'\u201E', '\u2026', '\u2030', '\u2022', '\u2013', '\u2014', '\u2070', '\u00C1',
|
||||
new Rune(0x201E), new Rune(0x2026), new Rune(0x2030), new Rune(0x2022), new Rune(0x2013), new Rune(0x2014),
|
||||
new Rune(0x2070), new Rune(0x00C1),
|
||||
|
||||
// 0xC8
|
||||
'\u00C2', '\u00C8', '\u00CA', '\u00CB', '\u00CC', '\u00CD', '\u00CE', '\u00CF',
|
||||
new Rune(0x00C2), new Rune(0x00C8), new Rune(0x00CA), new Rune(0x00CB), new Rune(0x00CC), new Rune(0x00CD),
|
||||
new Rune(0x00CE), new Rune(0x00CF),
|
||||
|
||||
// 0xD0
|
||||
'\u00D2', '\u00D3', '\u00D4', '\u0160', '\u0161', '\u00D9', '\u00DA', '\u00DB',
|
||||
new Rune(0x00D2), new Rune(0x00D3), new Rune(0x00D4), new Rune(0x0160), new Rune(0x0161), new Rune(0x00D9),
|
||||
new Rune(0x00DA), new Rune(0x00DB),
|
||||
|
||||
// 0xD8
|
||||
'\u0178', '\u00DF', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0x0178), new Rune(0x00DF), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0xE0
|
||||
'\u03B1', '\u03B2', '\u0393', '\u03C0', '\u03A3', '\u03C3', '\u00B5', '\u03C4',
|
||||
new Rune(0x03B1), new Rune(0x03B2), new Rune(0x0393), new Rune(0x03C0), new Rune(0x03A3), new Rune(0x03C3),
|
||||
new Rune(0x00B5), new Rune(0x03C4),
|
||||
|
||||
// 0xE8
|
||||
'\u03A6', '\u0398', '\u03A9', '\u03B4', '\u222E', '\u0278', '\u2208', '\u2229',
|
||||
new Rune(0x03A6), new Rune(0x0398), new Rune(0x03A9), new Rune(0x03B4), new Rune(0x222E), new Rune(0x0278),
|
||||
new Rune(0x2208), new Rune(0x2229),
|
||||
|
||||
// 0xF0
|
||||
'\u2261', '\u00B1', '\u2265', '\u2264', '\u2320', '\u2321', '\u00F7', '\u2248',
|
||||
new Rune(0x2261), new Rune(0x00B1), new Rune(0x2265), new Rune(0x2264), new Rune(0x2320), new Rune(0x2321),
|
||||
new Rune(0x00F7), new Rune(0x2248),
|
||||
|
||||
// 0xF8
|
||||
'\u00B0', '\u2219', '\u00B7', '\u221A', '\u207F', '\u00B2', '\u25A0', '\u2205'
|
||||
new Rune(0x00B0), new Rune(0x2219), new Rune(0x00B7), new Rune(0x221A), new Rune(0x207F), new Rune(0x00B2),
|
||||
new Rune(0x25A0), new Rune(0x2205)
|
||||
};
|
||||
|
||||
/// <summary>Converts a Unicode character to an GEM character</summary>
|
||||
/// <returns>GEM character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(Rune character) => character.Value switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u21E7': return 0x01;
|
||||
case '\u21E9': return 0x02;
|
||||
case '\u21E8': return 0x03;
|
||||
case '\u21E6': return 0x04;
|
||||
case '\u25FC': return 0x05;
|
||||
case '\u25C6': return 0x07;
|
||||
case '\u2713': return 0x08;
|
||||
case '\u266A': return 0x0B;
|
||||
case '\u25B4': return 0x0C;
|
||||
case '\u25BE': return 0x0D;
|
||||
case '\u25B8': return 0x0E;
|
||||
case '\u25C2': return 0x0F;
|
||||
case '\u25BA': return 0x10;
|
||||
case '\u25C4': return 0x11;
|
||||
case '\u29D3': return 0x12;
|
||||
case '\u2582': return 0x13;
|
||||
case '\u2195': return 0x16;
|
||||
case '\u21A8': return 0x17;
|
||||
case '\u2191': return 0x18;
|
||||
case '\u2193': return 0x19;
|
||||
case '\u2192': return 0x1A;
|
||||
case '\u2190': return 0x1B;
|
||||
case '\u221F': return 0x1C;
|
||||
case '\u2194': return 0x1D;
|
||||
case '\u25B2': return 0x1E;
|
||||
case '\u25BC': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u2302': return 0x7F;
|
||||
case '\u00C7': return 0x80;
|
||||
case '\u00FC': return 0x81;
|
||||
case '\u00E9': return 0x82;
|
||||
case '\u00E2': return 0x83;
|
||||
case '\u00E4': return 0x84;
|
||||
case '\u00E0': return 0x85;
|
||||
case '\u00E5': return 0x86;
|
||||
case '\u00E7': return 0x87;
|
||||
case '\u00EA': return 0x88;
|
||||
case '\u00EB': return 0x89;
|
||||
case '\u00E8': return 0x8A;
|
||||
case '\u00EF': return 0x8B;
|
||||
case '\u00EE': return 0x8C;
|
||||
case '\u00EC': return 0x8D;
|
||||
case '\u00C4': return 0x8E;
|
||||
case '\u00C5': return 0x8F;
|
||||
case '\u00C9': return 0x90;
|
||||
case '\u00E6': return 0x91;
|
||||
case '\u00C6': return 0x92;
|
||||
case '\u00F4': return 0x93;
|
||||
case '\u00F6': return 0x94;
|
||||
case '\u00F2': return 0x95;
|
||||
case '\u00FB': return 0x96;
|
||||
case '\u00F9': return 0x97;
|
||||
case '\u00FF': return 0x98;
|
||||
case '\u00D6': return 0x99;
|
||||
case '\u00DC': return 0x9A;
|
||||
case '\u00F8': return 0x9B;
|
||||
case '\u00A3': return 0x9C;
|
||||
case '\u00D8': return 0x9D;
|
||||
case '\u00A4': return 0x9E;
|
||||
case '\u0192': return 0x9F;
|
||||
case '\u00E1': return 0xA0;
|
||||
case '\u00ED': return 0xA1;
|
||||
case '\u00F3': return 0xA2;
|
||||
case '\u00FA': return 0xA3;
|
||||
case '\u00F1': return 0xA4;
|
||||
case '\u00D1': return 0xA5;
|
||||
case '\u00AA': return 0xA6;
|
||||
case '\u00BA': return 0xA7;
|
||||
case '\u00BF': return 0xA8;
|
||||
case '\u201C': return 0xA9;
|
||||
case '\u201D': return 0xAA;
|
||||
case '\u2039': return 0xAB;
|
||||
case '\u203A': return 0xAC;
|
||||
case '\u00A1': return 0xAD;
|
||||
case '\u00AB': return 0xAE;
|
||||
case '\u00BB': return 0xAF;
|
||||
case '\u00E3': return 0xB0;
|
||||
case '\u00F5': return 0xB1;
|
||||
case '\u00A5': return 0xB2;
|
||||
case '\u00A2': return 0xB3;
|
||||
case '\u0153': return 0xB4;
|
||||
case '\u0152': return 0xB5;
|
||||
case '\u00C0': return 0xB6;
|
||||
case '\u00C3': return 0xB7;
|
||||
case '\u00D5': return 0xB8;
|
||||
case '\u00A7': return 0xB9;
|
||||
case '\u2821': return 0xBA;
|
||||
case '\u2020': return 0xBB;
|
||||
case '\u00B6': return 0xBC;
|
||||
case '\u00A9': return 0xBD;
|
||||
case '\u00AE': return 0xBE;
|
||||
case '\u2122': return 0xBF;
|
||||
case '\u201E': return 0xC0;
|
||||
case '\u2026': return 0xC1;
|
||||
case '\u2030': return 0xC2;
|
||||
case '\u2022': return 0xC3;
|
||||
case '\u2013': return 0xC4;
|
||||
case '\u2014': return 0xC5;
|
||||
case '\u2070': return 0xC6;
|
||||
case '\u00C1': return 0xC7;
|
||||
case '\u00C2': return 0xC8;
|
||||
case '\u00C8': return 0xC9;
|
||||
case '\u00CA': return 0xCA;
|
||||
case '\u00CB': return 0xCB;
|
||||
case '\u00CC': return 0xCC;
|
||||
case '\u00CD': return 0xCD;
|
||||
case '\u00CE': return 0xCE;
|
||||
case '\u00CF': return 0xCF;
|
||||
case '\u00D2': return 0xD0;
|
||||
case '\u00D3': return 0xD1;
|
||||
case '\u00D4': return 0xD2;
|
||||
case '\u0160': return 0xD3;
|
||||
case '\u0161': return 0xD4;
|
||||
case '\u00D9': return 0xD5;
|
||||
case '\u00DA': return 0xD6;
|
||||
case '\u00DB': return 0xD7;
|
||||
case '\u0178': return 0xD8;
|
||||
case '\u00DF': return 0xD9;
|
||||
case '\u03B1': return 0xE0;
|
||||
case '\u03B2': return 0xE1;
|
||||
case '\u0393': return 0xE2;
|
||||
case '\u03C0': return 0xE3;
|
||||
case '\u03A3': return 0xE4;
|
||||
case '\u03C3': return 0xE5;
|
||||
case '\u00B5': return 0xE6;
|
||||
case '\u03C4': return 0xE7;
|
||||
case '\u03A6': return 0xE8;
|
||||
case '\u0398': return 0xE9;
|
||||
case '\u03A9': return 0xEA;
|
||||
case '\u03B4': return 0xEB;
|
||||
case '\u222E': return 0xEC;
|
||||
case '\u0278': return 0xED;
|
||||
case '\u2208': return 0xEE;
|
||||
case '\u2229': return 0xEF;
|
||||
case '\u2261': return 0xF0;
|
||||
case '\u00B1': return 0xF1;
|
||||
case '\u2265': return 0xF2;
|
||||
case '\u2264': return 0xF3;
|
||||
case '\u2320': return 0xF4;
|
||||
case '\u2321': return 0xF5;
|
||||
case '\u00F7': return 0xF6;
|
||||
case '\u2248': return 0xF7;
|
||||
case '\u00B0': return 0xF8;
|
||||
case '\u2219': return 0xF9;
|
||||
case '\u00B7': return 0xFA;
|
||||
case '\u221A': return 0xFB;
|
||||
case '\u207F': return 0xFC;
|
||||
case '\u00B2': return 0xFD;
|
||||
case '\u25A0': return 0xFE;
|
||||
case '\u2205': return 0xFF;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
0x0000 => 0x00,
|
||||
0x21E7 => 0x01,
|
||||
0x21E9 => 0x02,
|
||||
0x21E8 => 0x03,
|
||||
0x21E6 => 0x04,
|
||||
0x25FC => 0x05,
|
||||
0x1F5D7 => 0x06,
|
||||
0x25C6 => 0x07,
|
||||
0x2713 => 0x08,
|
||||
0x1F552 => 0x09,
|
||||
0x1F514 => 0x0A,
|
||||
0x266A => 0x0B,
|
||||
0x25B4 => 0x0C,
|
||||
0x25BE => 0x0D,
|
||||
0x25B8 => 0x0E,
|
||||
0x25C2 => 0x0F,
|
||||
0x25BA => 0x10,
|
||||
0x25C4 => 0x11,
|
||||
0x29D3 => 0x12,
|
||||
0x2582 => 0x13,
|
||||
0x2195 => 0x16,
|
||||
0x21A8 => 0x17,
|
||||
0x2191 => 0x18,
|
||||
0x2193 => 0x19,
|
||||
0x2192 => 0x1A,
|
||||
0x2190 => 0x1B,
|
||||
0x221F => 0x1C,
|
||||
0x2194 => 0x1D,
|
||||
0x25B2 => 0x1E,
|
||||
0x25BC => 0x1F,
|
||||
0x0020 => 0x20,
|
||||
0x0021 => 0x21,
|
||||
0x0022 => 0x22,
|
||||
0x0023 => 0x23,
|
||||
0x0024 => 0x24,
|
||||
0x0025 => 0x25,
|
||||
0x0026 => 0x26,
|
||||
0x0027 => 0x27,
|
||||
0x0028 => 0x28,
|
||||
0x0029 => 0x29,
|
||||
0x002A => 0x2A,
|
||||
0x002B => 0x2B,
|
||||
0x002C => 0x2C,
|
||||
0x002D => 0x2D,
|
||||
0x002E => 0x2E,
|
||||
0x002F => 0x2F,
|
||||
0x0030 => 0x30,
|
||||
0x0031 => 0x31,
|
||||
0x0032 => 0x32,
|
||||
0x0033 => 0x33,
|
||||
0x0034 => 0x34,
|
||||
0x0035 => 0x35,
|
||||
0x0036 => 0x36,
|
||||
0x0037 => 0x37,
|
||||
0x0038 => 0x38,
|
||||
0x0039 => 0x39,
|
||||
0x003A => 0x3A,
|
||||
0x003B => 0x3B,
|
||||
0x003C => 0x3C,
|
||||
0x003D => 0x3D,
|
||||
0x003E => 0x3E,
|
||||
0x003F => 0x3F,
|
||||
0x0040 => 0x40,
|
||||
0x0041 => 0x41,
|
||||
0x0042 => 0x42,
|
||||
0x0043 => 0x43,
|
||||
0x0044 => 0x44,
|
||||
0x0045 => 0x45,
|
||||
0x0046 => 0x46,
|
||||
0x0047 => 0x47,
|
||||
0x0048 => 0x48,
|
||||
0x0049 => 0x49,
|
||||
0x004A => 0x4A,
|
||||
0x004B => 0x4B,
|
||||
0x004C => 0x4C,
|
||||
0x004D => 0x4D,
|
||||
0x004E => 0x4E,
|
||||
0x004F => 0x4F,
|
||||
0x0050 => 0x50,
|
||||
0x0051 => 0x51,
|
||||
0x0052 => 0x52,
|
||||
0x0053 => 0x53,
|
||||
0x0054 => 0x54,
|
||||
0x0055 => 0x55,
|
||||
0x0056 => 0x56,
|
||||
0x0057 => 0x57,
|
||||
0x0058 => 0x58,
|
||||
0x0059 => 0x59,
|
||||
0x005A => 0x5A,
|
||||
0x005B => 0x5B,
|
||||
0x005C => 0x5C,
|
||||
0x005D => 0x5D,
|
||||
0x005E => 0x5E,
|
||||
0x005F => 0x5F,
|
||||
0x0060 => 0x60,
|
||||
0x0061 => 0x61,
|
||||
0x0062 => 0x62,
|
||||
0x0063 => 0x63,
|
||||
0x0064 => 0x64,
|
||||
0x0065 => 0x65,
|
||||
0x0066 => 0x66,
|
||||
0x0067 => 0x67,
|
||||
0x0068 => 0x68,
|
||||
0x0069 => 0x69,
|
||||
0x006A => 0x6A,
|
||||
0x006B => 0x6B,
|
||||
0x006C => 0x6C,
|
||||
0x006D => 0x6D,
|
||||
0x006E => 0x6E,
|
||||
0x006F => 0x6F,
|
||||
0x0070 => 0x70,
|
||||
0x0071 => 0x71,
|
||||
0x0072 => 0x72,
|
||||
0x0073 => 0x73,
|
||||
0x0074 => 0x74,
|
||||
0x0075 => 0x75,
|
||||
0x0076 => 0x76,
|
||||
0x0077 => 0x77,
|
||||
0x0078 => 0x78,
|
||||
0x0079 => 0x79,
|
||||
0x007A => 0x7A,
|
||||
0x007B => 0x7B,
|
||||
0x007C => 0x7C,
|
||||
0x007D => 0x7D,
|
||||
0x007E => 0x7E,
|
||||
0x2302 => 0x7F,
|
||||
0x00C7 => 0x80,
|
||||
0x00FC => 0x81,
|
||||
0x00E9 => 0x82,
|
||||
0x00E2 => 0x83,
|
||||
0x00E4 => 0x84,
|
||||
0x00E0 => 0x85,
|
||||
0x00E5 => 0x86,
|
||||
0x00E7 => 0x87,
|
||||
0x00EA => 0x88,
|
||||
0x00EB => 0x89,
|
||||
0x00E8 => 0x8A,
|
||||
0x00EF => 0x8B,
|
||||
0x00EE => 0x8C,
|
||||
0x00EC => 0x8D,
|
||||
0x00C4 => 0x8E,
|
||||
0x00C5 => 0x8F,
|
||||
0x00C9 => 0x90,
|
||||
0x00E6 => 0x91,
|
||||
0x00C6 => 0x92,
|
||||
0x00F4 => 0x93,
|
||||
0x00F6 => 0x94,
|
||||
0x00F2 => 0x95,
|
||||
0x00FB => 0x96,
|
||||
0x00F9 => 0x97,
|
||||
0x00FF => 0x98,
|
||||
0x00D6 => 0x99,
|
||||
0x00DC => 0x9A,
|
||||
0x00F8 => 0x9B,
|
||||
0x00A3 => 0x9C,
|
||||
0x00D8 => 0x9D,
|
||||
0x00A4 => 0x9E,
|
||||
0x0192 => 0x9F,
|
||||
0x00E1 => 0xA0,
|
||||
0x00ED => 0xA1,
|
||||
0x00F3 => 0xA2,
|
||||
0x00FA => 0xA3,
|
||||
0x00F1 => 0xA4,
|
||||
0x00D1 => 0xA5,
|
||||
0x00AA => 0xA6,
|
||||
0x00BA => 0xA7,
|
||||
0x00BF => 0xA8,
|
||||
0x201C => 0xA9,
|
||||
0x201D => 0xAA,
|
||||
0x2039 => 0xAB,
|
||||
0x203A => 0xAC,
|
||||
0x00A1 => 0xAD,
|
||||
0x00AB => 0xAE,
|
||||
0x00BB => 0xAF,
|
||||
0x00E3 => 0xB0,
|
||||
0x00F5 => 0xB1,
|
||||
0x00A5 => 0xB2,
|
||||
0x00A2 => 0xB3,
|
||||
0x0153 => 0xB4,
|
||||
0x0152 => 0xB5,
|
||||
0x00C0 => 0xB6,
|
||||
0x00C3 => 0xB7,
|
||||
0x00D5 => 0xB8,
|
||||
0x00A7 => 0xB9,
|
||||
0x2821 => 0xBA,
|
||||
0x2020 => 0xBB,
|
||||
0x00B6 => 0xBC,
|
||||
0x00A9 => 0xBD,
|
||||
0x00AE => 0xBE,
|
||||
0x2122 => 0xBF,
|
||||
0x201E => 0xC0,
|
||||
0x2026 => 0xC1,
|
||||
0x2030 => 0xC2,
|
||||
0x2022 => 0xC3,
|
||||
0x2013 => 0xC4,
|
||||
0x2014 => 0xC5,
|
||||
0x2070 => 0xC6,
|
||||
0x00C1 => 0xC7,
|
||||
0x00C2 => 0xC8,
|
||||
0x00C8 => 0xC9,
|
||||
0x00CA => 0xCA,
|
||||
0x00CB => 0xCB,
|
||||
0x00CC => 0xCC,
|
||||
0x00CD => 0xCD,
|
||||
0x00CE => 0xCE,
|
||||
0x00CF => 0xCF,
|
||||
0x00D2 => 0xD0,
|
||||
0x00D3 => 0xD1,
|
||||
0x00D4 => 0xD2,
|
||||
0x0160 => 0xD3,
|
||||
0x0161 => 0xD4,
|
||||
0x00D9 => 0xD5,
|
||||
0x00DA => 0xD6,
|
||||
0x00DB => 0xD7,
|
||||
0x0178 => 0xD8,
|
||||
0x00DF => 0xD9,
|
||||
0x03B1 => 0xE0,
|
||||
0x03B2 => 0xE1,
|
||||
0x0393 => 0xE2,
|
||||
0x03C0 => 0xE3,
|
||||
0x03A3 => 0xE4,
|
||||
0x03C3 => 0xE5,
|
||||
0x00B5 => 0xE6,
|
||||
0x03C4 => 0xE7,
|
||||
0x03A6 => 0xE8,
|
||||
0x0398 => 0xE9,
|
||||
0x03A9 => 0xEA,
|
||||
0x03B4 => 0xEB,
|
||||
0x222E => 0xEC,
|
||||
0x0278 => 0xED,
|
||||
0x2208 => 0xEE,
|
||||
0x2229 => 0xEF,
|
||||
0x2261 => 0xF0,
|
||||
0x00B1 => 0xF1,
|
||||
0x2265 => 0xF2,
|
||||
0x2264 => 0xF3,
|
||||
0x2320 => 0xF4,
|
||||
0x2321 => 0xF5,
|
||||
0x00F7 => 0xF6,
|
||||
0x2248 => 0xF7,
|
||||
0x00B0 => 0xF8,
|
||||
0x2219 => 0xF9,
|
||||
0x00B7 => 0xFA,
|
||||
0x221A => 0xFB,
|
||||
0x207F => 0xFC,
|
||||
0x00B2 => 0xFD,
|
||||
0x25A0 => 0xFE,
|
||||
0x2205 => 0xFF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an GEOS character encoding of Unicode characters.</summary>
|
||||
public class Geos : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "geos";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Western European (GEOS)";
|
||||
public override string HeaderName => "geos";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "geos";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Western European (GEOS)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "geos";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => false;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>
|
||||
/// The GEOS to Unicode character map. In the GEOS character map application lots of positions appears as '\u002E'
|
||||
@@ -149,254 +161,249 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an GEOS character</summary>
|
||||
/// <returns>GEOS character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u00C4': return 0x80;
|
||||
case '\u00C5': return 0x81;
|
||||
case '\u00C7': return 0x82;
|
||||
case '\u00C9': return 0x83;
|
||||
case '\u00D1': return 0x84;
|
||||
case '\u00D6': return 0x85;
|
||||
case '\u00DC': return 0x86;
|
||||
case '\u00E1': return 0x87;
|
||||
case '\u00E0': return 0x88;
|
||||
case '\u00E2': return 0x89;
|
||||
case '\u00E4': return 0x8A;
|
||||
case '\u00E3': return 0x8B;
|
||||
case '\u00E5': return 0x8C;
|
||||
case '\u00E7': return 0x8D;
|
||||
case '\u00E9': return 0x8E;
|
||||
case '\u00E8': return 0x8F;
|
||||
case '\u00EA': return 0x90;
|
||||
case '\u00EB': return 0x91;
|
||||
case '\u00ED': return 0x92;
|
||||
case '\u00EC': return 0x93;
|
||||
case '\u00EE': return 0x94;
|
||||
case '\u00EF': return 0x95;
|
||||
case '\u00F1': return 0x96;
|
||||
case '\u00F3': return 0x97;
|
||||
case '\u00F2': return 0x98;
|
||||
case '\u00F4': return 0x99;
|
||||
case '\u00F5': return 0x9A;
|
||||
case '\u00FA': return 0x9B;
|
||||
case '\u00F9': return 0x9C;
|
||||
case '\u00FB': return 0x9D;
|
||||
case '\u00FC': return 0x9E;
|
||||
case '\u2020': return 0x9F;
|
||||
case '\u00B0': return 0xA0;
|
||||
case '\u00A2': return 0xA1;
|
||||
case '\u00A3': return 0xA2;
|
||||
case '\u00A7': return 0xA3;
|
||||
case '\u00B7': return 0xA4;
|
||||
case '\u00B6': return 0xA5;
|
||||
case '\u00DF': return 0xA6;
|
||||
case '\u00AE': return 0xA7;
|
||||
case '\u00A9': return 0xA8;
|
||||
case '\u2122': return 0xA9;
|
||||
case '\u00C6': return 0xAD;
|
||||
case '\u00D8': return 0xAE;
|
||||
case '\u221E': return 0xAF;
|
||||
case '\u00B1': return 0xB0;
|
||||
case '\u2264': return 0xB1;
|
||||
case '\u2265': return 0xB2;
|
||||
case '\u00A5': return 0xB3;
|
||||
case '\u00B5': return 0xB4;
|
||||
case '\u03C0': return 0xB8;
|
||||
case '\u00AA': return 0xBA;
|
||||
case '\u00BA': return 0xBB;
|
||||
case '\u03A9': return 0xBC;
|
||||
case '\u00E6': return 0xBD;
|
||||
case '\u00F8': return 0xBE;
|
||||
case '\u00BF': return 0xBF;
|
||||
case '\u00A1': return 0xC0;
|
||||
case '\u00AC': return 0xC1;
|
||||
case '\u221A': return 0xC2;
|
||||
case '\u0192': return 0xC3;
|
||||
case '\u2248': return 0xC4;
|
||||
case '\u00AB': return 0xC6;
|
||||
case '\u00BB': return 0xC7;
|
||||
case '\u2026': return 0xC8;
|
||||
case '\u00A0': return 0xC9;
|
||||
case '\u00C0': return 0xCA;
|
||||
case '\u00C3': return 0xCB;
|
||||
case '\u00D5': return 0xCC;
|
||||
case '\u0152': return 0xCD;
|
||||
case '\u0153': return 0xCE;
|
||||
case '\u2013': return 0xCF;
|
||||
case '\u2014': return 0xD0;
|
||||
case '\u201C': return 0xD1;
|
||||
case '\u201D': return 0xD2;
|
||||
case '\u2018': return 0xD3;
|
||||
case '\u2019': return 0xD4;
|
||||
case '\u00F7': return 0xD5;
|
||||
case '\u00FF': return 0xD7;
|
||||
case '\u0178': return 0xD8;
|
||||
case '\u05A4': return 0xDA;
|
||||
case '\u2039': return 0xDB;
|
||||
case '\u203A': return 0xDC;
|
||||
case '\u00FD': return 0xDD;
|
||||
case '\u00DD': return 0xDE;
|
||||
case '\u2021': return 0xDF;
|
||||
case '\u201A': return 0xE1;
|
||||
case '\u201E': return 0xE2;
|
||||
case '\u2030': return 0xE3;
|
||||
case '\u00C2': return 0xE4;
|
||||
case '\u00CA': return 0xE5;
|
||||
case '\u00C1': return 0xE6;
|
||||
case '\u00CB': return 0xE7;
|
||||
case '\u00C8': return 0xE8;
|
||||
case '\u00CD': return 0xE9;
|
||||
case '\u00CE': return 0xEA;
|
||||
case '\u00CF': return 0xEB;
|
||||
case '\u00CC': return 0xEC;
|
||||
case '\u00D3': return 0xED;
|
||||
case '\u00D4': return 0xEE;
|
||||
case '\u00D2': return 0xF0;
|
||||
case '\u00DA': return 0xF1;
|
||||
case '\u00D9': return 0xF2;
|
||||
case '\u00B9': return 0xF3;
|
||||
case '\u20C6': return 0xF4;
|
||||
case '\u20DC': return 0xF5;
|
||||
case '\u00AF': return 0xF6;
|
||||
case '\u02C7': return 0xF7;
|
||||
case '\u00B8': return 0xFA;
|
||||
case '\u2032': return 0xFB;
|
||||
case '\u02DB': return 0xFC;
|
||||
case '\u02D8': return 0xFD;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u0011' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u0014' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u007F' => 0x7F,
|
||||
'\u00C4' => 0x80,
|
||||
'\u00C5' => 0x81,
|
||||
'\u00C7' => 0x82,
|
||||
'\u00C9' => 0x83,
|
||||
'\u00D1' => 0x84,
|
||||
'\u00D6' => 0x85,
|
||||
'\u00DC' => 0x86,
|
||||
'\u00E1' => 0x87,
|
||||
'\u00E0' => 0x88,
|
||||
'\u00E2' => 0x89,
|
||||
'\u00E4' => 0x8A,
|
||||
'\u00E3' => 0x8B,
|
||||
'\u00E5' => 0x8C,
|
||||
'\u00E7' => 0x8D,
|
||||
'\u00E9' => 0x8E,
|
||||
'\u00E8' => 0x8F,
|
||||
'\u00EA' => 0x90,
|
||||
'\u00EB' => 0x91,
|
||||
'\u00ED' => 0x92,
|
||||
'\u00EC' => 0x93,
|
||||
'\u00EE' => 0x94,
|
||||
'\u00EF' => 0x95,
|
||||
'\u00F1' => 0x96,
|
||||
'\u00F3' => 0x97,
|
||||
'\u00F2' => 0x98,
|
||||
'\u00F4' => 0x99,
|
||||
'\u00F5' => 0x9A,
|
||||
'\u00FA' => 0x9B,
|
||||
'\u00F9' => 0x9C,
|
||||
'\u00FB' => 0x9D,
|
||||
'\u00FC' => 0x9E,
|
||||
'\u2020' => 0x9F,
|
||||
'\u00B0' => 0xA0,
|
||||
'\u00A2' => 0xA1,
|
||||
'\u00A3' => 0xA2,
|
||||
'\u00A7' => 0xA3,
|
||||
'\u00B7' => 0xA4,
|
||||
'\u00B6' => 0xA5,
|
||||
'\u00DF' => 0xA6,
|
||||
'\u00AE' => 0xA7,
|
||||
'\u00A9' => 0xA8,
|
||||
'\u2122' => 0xA9,
|
||||
'\u00C6' => 0xAD,
|
||||
'\u00D8' => 0xAE,
|
||||
'\u221E' => 0xAF,
|
||||
'\u00B1' => 0xB0,
|
||||
'\u2264' => 0xB1,
|
||||
'\u2265' => 0xB2,
|
||||
'\u00A5' => 0xB3,
|
||||
'\u00B5' => 0xB4,
|
||||
'\u03C0' => 0xB8,
|
||||
'\u00AA' => 0xBA,
|
||||
'\u00BA' => 0xBB,
|
||||
'\u03A9' => 0xBC,
|
||||
'\u00E6' => 0xBD,
|
||||
'\u00F8' => 0xBE,
|
||||
'\u00BF' => 0xBF,
|
||||
'\u00A1' => 0xC0,
|
||||
'\u00AC' => 0xC1,
|
||||
'\u221A' => 0xC2,
|
||||
'\u0192' => 0xC3,
|
||||
'\u2248' => 0xC4,
|
||||
'\u00AB' => 0xC6,
|
||||
'\u00BB' => 0xC7,
|
||||
'\u2026' => 0xC8,
|
||||
'\u00A0' => 0xC9,
|
||||
'\u00C0' => 0xCA,
|
||||
'\u00C3' => 0xCB,
|
||||
'\u00D5' => 0xCC,
|
||||
'\u0152' => 0xCD,
|
||||
'\u0153' => 0xCE,
|
||||
'\u2013' => 0xCF,
|
||||
'\u2014' => 0xD0,
|
||||
'\u201C' => 0xD1,
|
||||
'\u201D' => 0xD2,
|
||||
'\u2018' => 0xD3,
|
||||
'\u2019' => 0xD4,
|
||||
'\u00F7' => 0xD5,
|
||||
'\u00FF' => 0xD7,
|
||||
'\u0178' => 0xD8,
|
||||
'\u05A4' => 0xDA,
|
||||
'\u2039' => 0xDB,
|
||||
'\u203A' => 0xDC,
|
||||
'\u00FD' => 0xDD,
|
||||
'\u00DD' => 0xDE,
|
||||
'\u2021' => 0xDF,
|
||||
'\u201A' => 0xE1,
|
||||
'\u201E' => 0xE2,
|
||||
'\u2030' => 0xE3,
|
||||
'\u00C2' => 0xE4,
|
||||
'\u00CA' => 0xE5,
|
||||
'\u00C1' => 0xE6,
|
||||
'\u00CB' => 0xE7,
|
||||
'\u00C8' => 0xE8,
|
||||
'\u00CD' => 0xE9,
|
||||
'\u00CE' => 0xEA,
|
||||
'\u00CF' => 0xEB,
|
||||
'\u00CC' => 0xEC,
|
||||
'\u00D3' => 0xED,
|
||||
'\u00D4' => 0xEE,
|
||||
'\u00D2' => 0xF0,
|
||||
'\u00DA' => 0xF1,
|
||||
'\u00D9' => 0xF2,
|
||||
'\u00B9' => 0xF3,
|
||||
'\u20C6' => 0xF4,
|
||||
'\u20DC' => 0xF5,
|
||||
'\u00AF' => 0xF6,
|
||||
'\u02C7' => 0xF7,
|
||||
'\u00B8' => 0xFA,
|
||||
'\u2032' => 0xFB,
|
||||
'\u02DB' => 0xFC,
|
||||
'\u02D8' => 0xFD,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Apple Lisa character encoding of Unicode characters.</summary>
|
||||
public class LisaRoman : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "lisa";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Western European (Apple Lisa)";
|
||||
public override string HeaderName => "lisa";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 10000;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "lisa";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Western European (Apple Lisa)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "lisa";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 10000;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => false;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Lisa to Unicode character map. MacRoman is a superset of LisaRoman.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -146,231 +158,226 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an LisaRoman character</summary>
|
||||
/// <returns>LisaRoman character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u2588': return 0x7F;
|
||||
case '\u00C4': return 0x80;
|
||||
case '\u00C5': return 0x81;
|
||||
case '\u00C7': return 0x82;
|
||||
case '\u00C9': return 0x83;
|
||||
case '\u00D1': return 0x84;
|
||||
case '\u00D6': return 0x85;
|
||||
case '\u00DC': return 0x86;
|
||||
case '\u00E1': return 0x87;
|
||||
case '\u00E0': return 0x88;
|
||||
case '\u00E2': return 0x89;
|
||||
case '\u00E4': return 0x8A;
|
||||
case '\u00E3': return 0x8B;
|
||||
case '\u00E5': return 0x8C;
|
||||
case '\u00E7': return 0x8D;
|
||||
case '\u00E9': return 0x8E;
|
||||
case '\u00E8': return 0x8F;
|
||||
case '\u00EA': return 0x90;
|
||||
case '\u00EB': return 0x91;
|
||||
case '\u00ED': return 0x92;
|
||||
case '\u00EC': return 0x93;
|
||||
case '\u00EE': return 0x94;
|
||||
case '\u00EF': return 0x95;
|
||||
case '\u00F1': return 0x96;
|
||||
case '\u00F3': return 0x97;
|
||||
case '\u00F2': return 0x98;
|
||||
case '\u00F4': return 0x99;
|
||||
case '\u00F6': return 0x9A;
|
||||
case '\u00F5': return 0x9B;
|
||||
case '\u00FA': return 0x9C;
|
||||
case '\u00F9': return 0x9D;
|
||||
case '\u00FB': return 0x9E;
|
||||
case '\u00FC': return 0x9F;
|
||||
case '\u2020': return 0xA0;
|
||||
case '\u00B0': return 0xA1;
|
||||
case '\u00A2': return 0xA2;
|
||||
case '\u00A3': return 0xA3;
|
||||
case '\u00A7': return 0xA4;
|
||||
case '\u2022': return 0xA5;
|
||||
case '\u00B6': return 0xA6;
|
||||
case '\u00DF': return 0xA7;
|
||||
case '\u00AE': return 0xA8;
|
||||
case '\u00A9': return 0xA9;
|
||||
case '\u2122': return 0xAA;
|
||||
case '\u00B4': return 0xAB;
|
||||
case '\u00A8': return 0xAC;
|
||||
case '\u2260': return 0xAD;
|
||||
case '\u00C6': return 0xAE;
|
||||
case '\u00D8': return 0xAF;
|
||||
case '\u221E': return 0xB0;
|
||||
case '\u00B1': return 0xB1;
|
||||
case '\u2264': return 0xB2;
|
||||
case '\u2265': return 0xB3;
|
||||
case '\u00A5': return 0xB4;
|
||||
case '\u00B5': return 0xB5;
|
||||
case '\u2202': return 0xB6;
|
||||
case '\u2211': return 0xB7;
|
||||
case '\u220F': return 0xB8;
|
||||
case '\u03C0': return 0xB9;
|
||||
case '\u222B': return 0xBA;
|
||||
case '\u00AA': return 0xBB;
|
||||
case '\u00BA': return 0xBC;
|
||||
case '\u03A9': return 0xBD;
|
||||
case '\u00E6': return 0xBE;
|
||||
case '\u00F8': return 0xBF;
|
||||
case '\u00BF': return 0xC0;
|
||||
case '\u00A1': return 0xC1;
|
||||
case '\u00AC': return 0xC2;
|
||||
case '\u221A': return 0xC3;
|
||||
case '\u0192': return 0xC4;
|
||||
case '\u2248': return 0xC5;
|
||||
case '\u2206': return 0xC6;
|
||||
case '\u00AB': return 0xC7;
|
||||
case '\u00BB': return 0xC8;
|
||||
case '\u2026': return 0xC9;
|
||||
case '\u00A0': return 0xCA;
|
||||
case '\u00C0': return 0xCB;
|
||||
case '\u00C3': return 0xCC;
|
||||
case '\u00D5': return 0xCD;
|
||||
case '\u0152': return 0xCE;
|
||||
case '\u0153': return 0xCF;
|
||||
case '\u2013': return 0xD0;
|
||||
case '\u2014': return 0xD1;
|
||||
case '\u201C': return 0xD2;
|
||||
case '\u201D': return 0xD3;
|
||||
case '\u2018': return 0xD4;
|
||||
case '\u2019': return 0xD5;
|
||||
case '\u00F7': return 0xD6;
|
||||
case '\u25CA': return 0xD7;
|
||||
case '\u00FF': return 0xD8;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u0011' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u0014' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u2588' => 0x7F,
|
||||
'\u00C4' => 0x80,
|
||||
'\u00C5' => 0x81,
|
||||
'\u00C7' => 0x82,
|
||||
'\u00C9' => 0x83,
|
||||
'\u00D1' => 0x84,
|
||||
'\u00D6' => 0x85,
|
||||
'\u00DC' => 0x86,
|
||||
'\u00E1' => 0x87,
|
||||
'\u00E0' => 0x88,
|
||||
'\u00E2' => 0x89,
|
||||
'\u00E4' => 0x8A,
|
||||
'\u00E3' => 0x8B,
|
||||
'\u00E5' => 0x8C,
|
||||
'\u00E7' => 0x8D,
|
||||
'\u00E9' => 0x8E,
|
||||
'\u00E8' => 0x8F,
|
||||
'\u00EA' => 0x90,
|
||||
'\u00EB' => 0x91,
|
||||
'\u00ED' => 0x92,
|
||||
'\u00EC' => 0x93,
|
||||
'\u00EE' => 0x94,
|
||||
'\u00EF' => 0x95,
|
||||
'\u00F1' => 0x96,
|
||||
'\u00F3' => 0x97,
|
||||
'\u00F2' => 0x98,
|
||||
'\u00F4' => 0x99,
|
||||
'\u00F6' => 0x9A,
|
||||
'\u00F5' => 0x9B,
|
||||
'\u00FA' => 0x9C,
|
||||
'\u00F9' => 0x9D,
|
||||
'\u00FB' => 0x9E,
|
||||
'\u00FC' => 0x9F,
|
||||
'\u2020' => 0xA0,
|
||||
'\u00B0' => 0xA1,
|
||||
'\u00A2' => 0xA2,
|
||||
'\u00A3' => 0xA3,
|
||||
'\u00A7' => 0xA4,
|
||||
'\u2022' => 0xA5,
|
||||
'\u00B6' => 0xA6,
|
||||
'\u00DF' => 0xA7,
|
||||
'\u00AE' => 0xA8,
|
||||
'\u00A9' => 0xA9,
|
||||
'\u2122' => 0xAA,
|
||||
'\u00B4' => 0xAB,
|
||||
'\u00A8' => 0xAC,
|
||||
'\u2260' => 0xAD,
|
||||
'\u00C6' => 0xAE,
|
||||
'\u00D8' => 0xAF,
|
||||
'\u221E' => 0xB0,
|
||||
'\u00B1' => 0xB1,
|
||||
'\u2264' => 0xB2,
|
||||
'\u2265' => 0xB3,
|
||||
'\u00A5' => 0xB4,
|
||||
'\u00B5' => 0xB5,
|
||||
'\u2202' => 0xB6,
|
||||
'\u2211' => 0xB7,
|
||||
'\u220F' => 0xB8,
|
||||
'\u03C0' => 0xB9,
|
||||
'\u222B' => 0xBA,
|
||||
'\u00AA' => 0xBB,
|
||||
'\u00BA' => 0xBC,
|
||||
'\u03A9' => 0xBD,
|
||||
'\u00E6' => 0xBE,
|
||||
'\u00F8' => 0xBF,
|
||||
'\u00BF' => 0xC0,
|
||||
'\u00A1' => 0xC1,
|
||||
'\u00AC' => 0xC2,
|
||||
'\u221A' => 0xC3,
|
||||
'\u0192' => 0xC4,
|
||||
'\u2248' => 0xC5,
|
||||
'\u2206' => 0xC6,
|
||||
'\u00AB' => 0xC7,
|
||||
'\u00BB' => 0xC8,
|
||||
'\u2026' => 0xC9,
|
||||
'\u00A0' => 0xCA,
|
||||
'\u00C0' => 0xCB,
|
||||
'\u00C3' => 0xCC,
|
||||
'\u00D5' => 0xCD,
|
||||
'\u0152' => 0xCE,
|
||||
'\u0153' => 0xCF,
|
||||
'\u2013' => 0xD0,
|
||||
'\u2014' => 0xD1,
|
||||
'\u201C' => 0xD2,
|
||||
'\u201D' => 0xD3,
|
||||
'\u2018' => 0xD4,
|
||||
'\u2019' => 0xD5,
|
||||
'\u00F7' => 0xD6,
|
||||
'\u25CA' => 0xD7,
|
||||
'\u00FF' => 0xD8,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Mac Arabic character encoding of Unicode characters.</summary>
|
||||
public class MacArabic : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "x-mac-arabic";
|
||||
public override int CodePage => 10004;
|
||||
public override string EncodingName => "Arabic (Mac)";
|
||||
public override string HeaderName => "x-mac-arabic";
|
||||
public override string WebName => "x-mac-arabic";
|
||||
public override int WindowsCodePage => 10004;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "x-mac-arabic";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 10004;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Arabic (Mac)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "x-mac-arabic";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "x-mac-arabic";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 10004;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Macintosh Arabic to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -53,7 +65,7 @@ namespace Claunia.Encoding
|
||||
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
|
||||
|
||||
// 0x10
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
|
||||
'\u0010', '\u2318', '\u2713', '\u25C6', '\uF8FF', '\u0015', '\u0016', '\u0017',
|
||||
|
||||
// 0x18
|
||||
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
|
||||
@@ -146,244 +158,242 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an Mac Arabic character</summary>
|
||||
/// <returns>Mac Arabic character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u00C4': return 0x80;
|
||||
case '\u00A0': return 0x81;
|
||||
case '\u00C7': return 0x82;
|
||||
case '\u00C9': return 0x83;
|
||||
case '\u00D1': return 0x84;
|
||||
case '\u00D6': return 0x85;
|
||||
case '\u00DC': return 0x86;
|
||||
case '\u00E1': return 0x87;
|
||||
case '\u00E0': return 0x88;
|
||||
case '\u00E2': return 0x89;
|
||||
case '\u00E4': return 0x8A;
|
||||
case '\u06BA': return 0x8B;
|
||||
case '\u00AB': return 0x8C;
|
||||
case '\u00E7': return 0x8D;
|
||||
case '\u00E9': return 0x8E;
|
||||
case '\u00E8': return 0x8F;
|
||||
case '\u00EA': return 0x90;
|
||||
case '\u00EB': return 0x91;
|
||||
case '\u00ED': return 0x92;
|
||||
case '\u2026': return 0x93;
|
||||
case '\u00EE': return 0x94;
|
||||
case '\u00EF': return 0x95;
|
||||
case '\u00F1': return 0x96;
|
||||
case '\u00F3': return 0x97;
|
||||
case '\u00BB': return 0x98;
|
||||
case '\u00F4': return 0x99;
|
||||
case '\u00F6': return 0x9A;
|
||||
case '\u00F7': return 0x9B;
|
||||
case '\u00FA': return 0x9C;
|
||||
case '\u00F9': return 0x9D;
|
||||
case '\u00FB': return 0x9E;
|
||||
case '\u00FC': return 0x9F;
|
||||
case '\u066A': return 0xA5;
|
||||
case '\u060C': return 0xAC;
|
||||
case '\u0660': return 0xB0;
|
||||
case '\u0661': return 0xB1;
|
||||
case '\u0662': return 0xB2;
|
||||
case '\u0663': return 0xB3;
|
||||
case '\u0664': return 0xB4;
|
||||
case '\u0665': return 0xB5;
|
||||
case '\u0666': return 0xB6;
|
||||
case '\u0667': return 0xB7;
|
||||
case '\u0668': return 0xB8;
|
||||
case '\u0669': return 0xB9;
|
||||
case '\u061B': return 0xBB;
|
||||
case '\u061F': return 0xBF;
|
||||
case '\u274A': return 0xC0;
|
||||
case '\u0621': return 0xC1;
|
||||
case '\u0622': return 0xC2;
|
||||
case '\u0623': return 0xC3;
|
||||
case '\u0624': return 0xC4;
|
||||
case '\u0625': return 0xC5;
|
||||
case '\u0626': return 0xC6;
|
||||
case '\u0627': return 0xC7;
|
||||
case '\u0628': return 0xC8;
|
||||
case '\u0629': return 0xC9;
|
||||
case '\u062A': return 0xCA;
|
||||
case '\u062B': return 0xCB;
|
||||
case '\u062C': return 0xCC;
|
||||
case '\u062D': return 0xCD;
|
||||
case '\u062E': return 0xCE;
|
||||
case '\u062F': return 0xCF;
|
||||
case '\u0630': return 0xD0;
|
||||
case '\u0631': return 0xD1;
|
||||
case '\u0632': return 0xD2;
|
||||
case '\u0633': return 0xD3;
|
||||
case '\u0634': return 0xD4;
|
||||
case '\u0635': return 0xD5;
|
||||
case '\u0636': return 0xD6;
|
||||
case '\u0637': return 0xD7;
|
||||
case '\u0638': return 0xD8;
|
||||
case '\u0639': return 0xD9;
|
||||
case '\u063A': return 0xDA;
|
||||
case '\u0640': return 0xE0;
|
||||
case '\u0641': return 0xE1;
|
||||
case '\u0642': return 0xE2;
|
||||
case '\u0643': return 0xE3;
|
||||
case '\u0644': return 0xE4;
|
||||
case '\u0645': return 0xE5;
|
||||
case '\u0646': return 0xE6;
|
||||
case '\u0647': return 0xE7;
|
||||
case '\u0648': return 0xE8;
|
||||
case '\u0649': return 0xE9;
|
||||
case '\u064A': return 0xEA;
|
||||
case '\u064B': return 0xEB;
|
||||
case '\u064C': return 0xEC;
|
||||
case '\u064D': return 0xED;
|
||||
case '\u064E': return 0xEE;
|
||||
case '\u064F': return 0xEF;
|
||||
case '\u0650': return 0xF0;
|
||||
case '\u0651': return 0xF1;
|
||||
case '\u0652': return 0xF2;
|
||||
case '\u067E': return 0xF3;
|
||||
case '\u0679': return 0xF4;
|
||||
case '\u0686': return 0xF5;
|
||||
case '\u06D5': return 0xF6;
|
||||
case '\u06A4': return 0xF7;
|
||||
case '\u06AF': return 0xF8;
|
||||
case '\u0688': return 0xF9;
|
||||
case '\u0691': return 0xFA;
|
||||
case '\u0698': return 0xFE;
|
||||
case '\u06D2': return 0xFF;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u2318' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u2713' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u25C6' => 0x13,
|
||||
'\u0014' => 0x14,
|
||||
'\uF8FF' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u007F' => 0x7F,
|
||||
'\u00C4' => 0x80,
|
||||
'\u00A0' => 0x81,
|
||||
'\u00C7' => 0x82,
|
||||
'\u00C9' => 0x83,
|
||||
'\u00D1' => 0x84,
|
||||
'\u00D6' => 0x85,
|
||||
'\u00DC' => 0x86,
|
||||
'\u00E1' => 0x87,
|
||||
'\u00E0' => 0x88,
|
||||
'\u00E2' => 0x89,
|
||||
'\u00E4' => 0x8A,
|
||||
'\u06BA' => 0x8B,
|
||||
'\u00AB' => 0x8C,
|
||||
'\u00E7' => 0x8D,
|
||||
'\u00E9' => 0x8E,
|
||||
'\u00E8' => 0x8F,
|
||||
'\u00EA' => 0x90,
|
||||
'\u00EB' => 0x91,
|
||||
'\u00ED' => 0x92,
|
||||
'\u2026' => 0x93,
|
||||
'\u00EE' => 0x94,
|
||||
'\u00EF' => 0x95,
|
||||
'\u00F1' => 0x96,
|
||||
'\u00F3' => 0x97,
|
||||
'\u00BB' => 0x98,
|
||||
'\u00F4' => 0x99,
|
||||
'\u00F6' => 0x9A,
|
||||
'\u00F7' => 0x9B,
|
||||
'\u00FA' => 0x9C,
|
||||
'\u00F9' => 0x9D,
|
||||
'\u00FB' => 0x9E,
|
||||
'\u00FC' => 0x9F,
|
||||
'\u066A' => 0xA5,
|
||||
'\u060C' => 0xAC,
|
||||
'\u0660' => 0xB0,
|
||||
'\u0661' => 0xB1,
|
||||
'\u0662' => 0xB2,
|
||||
'\u0663' => 0xB3,
|
||||
'\u0664' => 0xB4,
|
||||
'\u0665' => 0xB5,
|
||||
'\u0666' => 0xB6,
|
||||
'\u0667' => 0xB7,
|
||||
'\u0668' => 0xB8,
|
||||
'\u0669' => 0xB9,
|
||||
'\u061B' => 0xBB,
|
||||
'\u061F' => 0xBF,
|
||||
'\u274A' => 0xC0,
|
||||
'\u0621' => 0xC1,
|
||||
'\u0622' => 0xC2,
|
||||
'\u0623' => 0xC3,
|
||||
'\u0624' => 0xC4,
|
||||
'\u0625' => 0xC5,
|
||||
'\u0626' => 0xC6,
|
||||
'\u0627' => 0xC7,
|
||||
'\u0628' => 0xC8,
|
||||
'\u0629' => 0xC9,
|
||||
'\u062A' => 0xCA,
|
||||
'\u062B' => 0xCB,
|
||||
'\u062C' => 0xCC,
|
||||
'\u062D' => 0xCD,
|
||||
'\u062E' => 0xCE,
|
||||
'\u062F' => 0xCF,
|
||||
'\u0630' => 0xD0,
|
||||
'\u0631' => 0xD1,
|
||||
'\u0632' => 0xD2,
|
||||
'\u0633' => 0xD3,
|
||||
'\u0634' => 0xD4,
|
||||
'\u0635' => 0xD5,
|
||||
'\u0636' => 0xD6,
|
||||
'\u0637' => 0xD7,
|
||||
'\u0638' => 0xD8,
|
||||
'\u0639' => 0xD9,
|
||||
'\u063A' => 0xDA,
|
||||
'\u0640' => 0xE0,
|
||||
'\u0641' => 0xE1,
|
||||
'\u0642' => 0xE2,
|
||||
'\u0643' => 0xE3,
|
||||
'\u0644' => 0xE4,
|
||||
'\u0645' => 0xE5,
|
||||
'\u0646' => 0xE6,
|
||||
'\u0647' => 0xE7,
|
||||
'\u0648' => 0xE8,
|
||||
'\u0649' => 0xE9,
|
||||
'\u064A' => 0xEA,
|
||||
'\u064B' => 0xEB,
|
||||
'\u064C' => 0xEC,
|
||||
'\u064D' => 0xED,
|
||||
'\u064E' => 0xEE,
|
||||
'\u064F' => 0xEF,
|
||||
'\u0650' => 0xF0,
|
||||
'\u0651' => 0xF1,
|
||||
'\u0652' => 0xF2,
|
||||
'\u067E' => 0xF3,
|
||||
'\u0679' => 0xF4,
|
||||
'\u0686' => 0xF5,
|
||||
'\u06D5' => 0xF6,
|
||||
'\u06A4' => 0xF7,
|
||||
'\u06AF' => 0xF8,
|
||||
'\u0688' => 0xF9,
|
||||
'\u0691' => 0xFA,
|
||||
'\u0698' => 0xFE,
|
||||
'\u06D2' => 0xFF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Mac CentralEuropean character encoding of Unicode characters.</summary>
|
||||
public class MacCentralEuropean : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "x-mac-ce";
|
||||
public override int CodePage => 10029;
|
||||
public override string EncodingName => "Central European (Mac)";
|
||||
public override string HeaderName => "x-mac-ce";
|
||||
public override string WebName => "x-mac-ce";
|
||||
public override int WindowsCodePage => 10029;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "x-mac-ce";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 10029;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Central European (Mac)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "x-mac-ce";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "x-mac-ce";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 10029;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Macintosh CentralEuropean to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -53,7 +65,7 @@ namespace Claunia.Encoding
|
||||
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
|
||||
|
||||
// 0x10
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
|
||||
'\u0010', '\u2318', '\u2713', '\u25C6', '\uF8FF', '\u0015', '\u0016', '\u0017',
|
||||
|
||||
// 0x18
|
||||
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
|
||||
@@ -146,270 +158,268 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an Mac CentralEuropean character</summary>
|
||||
/// <returns>Mac CentralEuropean character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u00C4': return 0x80;
|
||||
case '\u0100': return 0x81;
|
||||
case '\u0101': return 0x82;
|
||||
case '\u00C9': return 0x83;
|
||||
case '\u0104': return 0x84;
|
||||
case '\u00D6': return 0x85;
|
||||
case '\u00DC': return 0x86;
|
||||
case '\u00E1': return 0x87;
|
||||
case '\u0105': return 0x88;
|
||||
case '\u010C': return 0x89;
|
||||
case '\u00E4': return 0x8A;
|
||||
case '\u010D': return 0x8B;
|
||||
case '\u0106': return 0x8C;
|
||||
case '\u0107': return 0x8D;
|
||||
case '\u00E9': return 0x8E;
|
||||
case '\u0179': return 0x8F;
|
||||
case '\u017A': return 0x90;
|
||||
case '\u010E': return 0x91;
|
||||
case '\u00ED': return 0x92;
|
||||
case '\u010F': return 0x93;
|
||||
case '\u0112': return 0x94;
|
||||
case '\u0113': return 0x95;
|
||||
case '\u0116': return 0x96;
|
||||
case '\u00F3': return 0x97;
|
||||
case '\u0117': return 0x98;
|
||||
case '\u00F4': return 0x99;
|
||||
case '\u00F6': return 0x9A;
|
||||
case '\u00F5': return 0x9B;
|
||||
case '\u00FA': return 0x9C;
|
||||
case '\u011A': return 0x9D;
|
||||
case '\u011B': return 0x9E;
|
||||
case '\u00FC': return 0x9F;
|
||||
case '\u2020': return 0xA0;
|
||||
case '\u00B0': return 0xA1;
|
||||
case '\u0118': return 0xA2;
|
||||
case '\u00A3': return 0xA3;
|
||||
case '\u00A7': return 0xA4;
|
||||
case '\u2022': return 0xA5;
|
||||
case '\u00B6': return 0xA6;
|
||||
case '\u00DF': return 0xA7;
|
||||
case '\u00AE': return 0xA8;
|
||||
case '\u00A9': return 0xA9;
|
||||
case '\u2122': return 0xAA;
|
||||
case '\u0119': return 0xAB;
|
||||
case '\u00A8': return 0xAC;
|
||||
case '\u2260': return 0xAD;
|
||||
case '\u0123': return 0xAE;
|
||||
case '\u012E': return 0xAF;
|
||||
case '\u012F': return 0xB0;
|
||||
case '\u012A': return 0xB1;
|
||||
case '\u2264': return 0xB2;
|
||||
case '\u2265': return 0xB3;
|
||||
case '\u012B': return 0xB4;
|
||||
case '\u0136': return 0xB5;
|
||||
case '\u2202': return 0xB6;
|
||||
case '\u2211': return 0xB7;
|
||||
case '\u0142': return 0xB8;
|
||||
case '\u013B': return 0xB9;
|
||||
case '\u013C': return 0xBA;
|
||||
case '\u013D': return 0xBB;
|
||||
case '\u013E': return 0xBC;
|
||||
case '\u0139': return 0xBD;
|
||||
case '\u013A': return 0xBE;
|
||||
case '\u0145': return 0xBF;
|
||||
case '\u0146': return 0xC0;
|
||||
case '\u0143': return 0xC1;
|
||||
case '\u00AC': return 0xC2;
|
||||
case '\u221A': return 0xC3;
|
||||
case '\u0144': return 0xC4;
|
||||
case '\u0147': return 0xC5;
|
||||
case '\u2206': return 0xC6;
|
||||
case '\u00AB': return 0xC7;
|
||||
case '\u00BB': return 0xC8;
|
||||
case '\u2026': return 0xC9;
|
||||
case '\u00A0': return 0xCA;
|
||||
case '\u0148': return 0xCB;
|
||||
case '\u0150': return 0xCC;
|
||||
case '\u00D5': return 0xCD;
|
||||
case '\u0151': return 0xCE;
|
||||
case '\u014C': return 0xCF;
|
||||
case '\u2013': return 0xD0;
|
||||
case '\u2014': return 0xD1;
|
||||
case '\u201C': return 0xD2;
|
||||
case '\u201D': return 0xD3;
|
||||
case '\u2018': return 0xD4;
|
||||
case '\u2019': return 0xD5;
|
||||
case '\u00F7': return 0xD6;
|
||||
case '\u05CA': return 0xD7;
|
||||
case '\u014D': return 0xD8;
|
||||
case '\u0154': return 0xD9;
|
||||
case '\u0155': return 0xDA;
|
||||
case '\u0158': return 0xDB;
|
||||
case '\u2039': return 0xDC;
|
||||
case '\u203A': return 0xDD;
|
||||
case '\u0159': return 0xDE;
|
||||
case '\u0156': return 0xDF;
|
||||
case '\u0157': return 0xE0;
|
||||
case '\u0160': return 0xE1;
|
||||
case '\u201A': return 0xE2;
|
||||
case '\u201E': return 0xE3;
|
||||
case '\u0161': return 0xE4;
|
||||
case '\u015A': return 0xE5;
|
||||
case '\u015B': return 0xE6;
|
||||
case '\u00C1': return 0xE7;
|
||||
case '\u0164': return 0xE8;
|
||||
case '\u0165': return 0xE9;
|
||||
case '\u00CD': return 0xEA;
|
||||
case '\u017D': return 0xEB;
|
||||
case '\u017E': return 0xEC;
|
||||
case '\u016A': return 0xED;
|
||||
case '\u00D3': return 0xEE;
|
||||
case '\u00D4': return 0xEF;
|
||||
case '\u016B': return 0xF0;
|
||||
case '\u016E': return 0xF1;
|
||||
case '\u00DA': return 0xF2;
|
||||
case '\u016F': return 0xF3;
|
||||
case '\u0170': return 0xF4;
|
||||
case '\u0171': return 0xF5;
|
||||
case '\u0172': return 0xF6;
|
||||
case '\u0173': return 0xF7;
|
||||
case '\u00DD': return 0xF8;
|
||||
case '\u00FD': return 0xF9;
|
||||
case '\u0137': return 0xFA;
|
||||
case '\u017B': return 0xFB;
|
||||
case '\u0141': return 0xFC;
|
||||
case '\u017C': return 0xFD;
|
||||
case '\u0122': return 0xFE;
|
||||
case '\u02C7': return 0xFF;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u2318' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u2713' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u25C6' => 0x13,
|
||||
'\u0014' => 0x14,
|
||||
'\uF8FF' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u007F' => 0x7F,
|
||||
'\u00C4' => 0x80,
|
||||
'\u0100' => 0x81,
|
||||
'\u0101' => 0x82,
|
||||
'\u00C9' => 0x83,
|
||||
'\u0104' => 0x84,
|
||||
'\u00D6' => 0x85,
|
||||
'\u00DC' => 0x86,
|
||||
'\u00E1' => 0x87,
|
||||
'\u0105' => 0x88,
|
||||
'\u010C' => 0x89,
|
||||
'\u00E4' => 0x8A,
|
||||
'\u010D' => 0x8B,
|
||||
'\u0106' => 0x8C,
|
||||
'\u0107' => 0x8D,
|
||||
'\u00E9' => 0x8E,
|
||||
'\u0179' => 0x8F,
|
||||
'\u017A' => 0x90,
|
||||
'\u010E' => 0x91,
|
||||
'\u00ED' => 0x92,
|
||||
'\u010F' => 0x93,
|
||||
'\u0112' => 0x94,
|
||||
'\u0113' => 0x95,
|
||||
'\u0116' => 0x96,
|
||||
'\u00F3' => 0x97,
|
||||
'\u0117' => 0x98,
|
||||
'\u00F4' => 0x99,
|
||||
'\u00F6' => 0x9A,
|
||||
'\u00F5' => 0x9B,
|
||||
'\u00FA' => 0x9C,
|
||||
'\u011A' => 0x9D,
|
||||
'\u011B' => 0x9E,
|
||||
'\u00FC' => 0x9F,
|
||||
'\u2020' => 0xA0,
|
||||
'\u00B0' => 0xA1,
|
||||
'\u0118' => 0xA2,
|
||||
'\u00A3' => 0xA3,
|
||||
'\u00A7' => 0xA4,
|
||||
'\u2022' => 0xA5,
|
||||
'\u00B6' => 0xA6,
|
||||
'\u00DF' => 0xA7,
|
||||
'\u00AE' => 0xA8,
|
||||
'\u00A9' => 0xA9,
|
||||
'\u2122' => 0xAA,
|
||||
'\u0119' => 0xAB,
|
||||
'\u00A8' => 0xAC,
|
||||
'\u2260' => 0xAD,
|
||||
'\u0123' => 0xAE,
|
||||
'\u012E' => 0xAF,
|
||||
'\u012F' => 0xB0,
|
||||
'\u012A' => 0xB1,
|
||||
'\u2264' => 0xB2,
|
||||
'\u2265' => 0xB3,
|
||||
'\u012B' => 0xB4,
|
||||
'\u0136' => 0xB5,
|
||||
'\u2202' => 0xB6,
|
||||
'\u2211' => 0xB7,
|
||||
'\u0142' => 0xB8,
|
||||
'\u013B' => 0xB9,
|
||||
'\u013C' => 0xBA,
|
||||
'\u013D' => 0xBB,
|
||||
'\u013E' => 0xBC,
|
||||
'\u0139' => 0xBD,
|
||||
'\u013A' => 0xBE,
|
||||
'\u0145' => 0xBF,
|
||||
'\u0146' => 0xC0,
|
||||
'\u0143' => 0xC1,
|
||||
'\u00AC' => 0xC2,
|
||||
'\u221A' => 0xC3,
|
||||
'\u0144' => 0xC4,
|
||||
'\u0147' => 0xC5,
|
||||
'\u2206' => 0xC6,
|
||||
'\u00AB' => 0xC7,
|
||||
'\u00BB' => 0xC8,
|
||||
'\u2026' => 0xC9,
|
||||
'\u00A0' => 0xCA,
|
||||
'\u0148' => 0xCB,
|
||||
'\u0150' => 0xCC,
|
||||
'\u00D5' => 0xCD,
|
||||
'\u0151' => 0xCE,
|
||||
'\u014C' => 0xCF,
|
||||
'\u2013' => 0xD0,
|
||||
'\u2014' => 0xD1,
|
||||
'\u201C' => 0xD2,
|
||||
'\u201D' => 0xD3,
|
||||
'\u2018' => 0xD4,
|
||||
'\u2019' => 0xD5,
|
||||
'\u00F7' => 0xD6,
|
||||
'\u05CA' => 0xD7,
|
||||
'\u014D' => 0xD8,
|
||||
'\u0154' => 0xD9,
|
||||
'\u0155' => 0xDA,
|
||||
'\u0158' => 0xDB,
|
||||
'\u2039' => 0xDC,
|
||||
'\u203A' => 0xDD,
|
||||
'\u0159' => 0xDE,
|
||||
'\u0156' => 0xDF,
|
||||
'\u0157' => 0xE0,
|
||||
'\u0160' => 0xE1,
|
||||
'\u201A' => 0xE2,
|
||||
'\u201E' => 0xE3,
|
||||
'\u0161' => 0xE4,
|
||||
'\u015A' => 0xE5,
|
||||
'\u015B' => 0xE6,
|
||||
'\u00C1' => 0xE7,
|
||||
'\u0164' => 0xE8,
|
||||
'\u0165' => 0xE9,
|
||||
'\u00CD' => 0xEA,
|
||||
'\u017D' => 0xEB,
|
||||
'\u017E' => 0xEC,
|
||||
'\u016A' => 0xED,
|
||||
'\u00D3' => 0xEE,
|
||||
'\u00D4' => 0xEF,
|
||||
'\u016B' => 0xF0,
|
||||
'\u016E' => 0xF1,
|
||||
'\u00DA' => 0xF2,
|
||||
'\u016F' => 0xF3,
|
||||
'\u0170' => 0xF4,
|
||||
'\u0171' => 0xF5,
|
||||
'\u0172' => 0xF6,
|
||||
'\u0173' => 0xF7,
|
||||
'\u00DD' => 0xF8,
|
||||
'\u00FD' => 0xF9,
|
||||
'\u0137' => 0xFA,
|
||||
'\u017B' => 0xFB,
|
||||
'\u0141' => 0xFC,
|
||||
'\u017C' => 0xFD,
|
||||
'\u0122' => 0xFE,
|
||||
'\u02C7' => 0xFF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Mac Croatian character encoding of Unicode characters.</summary>
|
||||
public class MacCroatian : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "x-mac-croatian";
|
||||
public override int CodePage => 10082;
|
||||
public override string EncodingName => "Croatian (Mac)";
|
||||
public override string HeaderName => "x-mac-croatian";
|
||||
public override string WebName => "x-mac-croatian";
|
||||
public override int WindowsCodePage => 10082;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "x-mac-croatian";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 10082;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Croatian (Mac)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "x-mac-croatian";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "x-mac-croatian";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 10082;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Macintosh Croatian to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -53,7 +65,7 @@ namespace Claunia.Encoding
|
||||
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
|
||||
|
||||
// 0x10
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
|
||||
'\u0010', '\u2318', '\u2713', '\u25C6', '\uF8FF', '\u0015', '\u0016', '\u0017',
|
||||
|
||||
// 0x18
|
||||
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
|
||||
@@ -146,270 +158,267 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an Mac Croatian character</summary>
|
||||
/// <returns>Mac Croatian character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u00C4': return 0x80;
|
||||
case '\u00C5': return 0x81;
|
||||
case '\u00C7': return 0x82;
|
||||
case '\u00C9': return 0x83;
|
||||
case '\u00D1': return 0x84;
|
||||
case '\u00D6': return 0x85;
|
||||
case '\u00DC': return 0x86;
|
||||
case '\u00E1': return 0x87;
|
||||
case '\u00E0': return 0x88;
|
||||
case '\u00E2': return 0x89;
|
||||
case '\u00E4': return 0x8A;
|
||||
case '\u00E3': return 0x8B;
|
||||
case '\u00E5': return 0x8C;
|
||||
case '\u00E7': return 0x8D;
|
||||
case '\u00E9': return 0x8E;
|
||||
case '\u00E8': return 0x8F;
|
||||
case '\u00EA': return 0x90;
|
||||
case '\u00EB': return 0x91;
|
||||
case '\u00ED': return 0x92;
|
||||
case '\u00EC': return 0x93;
|
||||
case '\u00EE': return 0x94;
|
||||
case '\u00EF': return 0x95;
|
||||
case '\u00F1': return 0x96;
|
||||
case '\u00F3': return 0x97;
|
||||
case '\u00F2': return 0x98;
|
||||
case '\u00F4': return 0x99;
|
||||
case '\u00F6': return 0x9A;
|
||||
case '\u00F5': return 0x9B;
|
||||
case '\u00FA': return 0x9C;
|
||||
case '\u00F9': return 0x9D;
|
||||
case '\u00FB': return 0x9E;
|
||||
case '\u00FC': return 0x9F;
|
||||
case '\u2020': return 0xA0;
|
||||
case '\u00B0': return 0xA1;
|
||||
case '\u00A2': return 0xA2;
|
||||
case '\u00A3': return 0xA3;
|
||||
case '\u00A7': return 0xA4;
|
||||
case '\u2022': return 0xA5;
|
||||
case '\u00B6': return 0xA6;
|
||||
case '\u00DF': return 0xA7;
|
||||
case '\u00AE': return 0xA8;
|
||||
case '\u0160': return 0xA9;
|
||||
case '\u2122': return 0xAA;
|
||||
case '\u00B4': return 0xAB;
|
||||
case '\u00A8': return 0xAC;
|
||||
case '\u2260': return 0xAD;
|
||||
case '\u017D': return 0xAE;
|
||||
case '\u00D8': return 0xAF;
|
||||
case '\u221E': return 0xB0;
|
||||
case '\u00B1': return 0xB1;
|
||||
case '\u2264': return 0xB2;
|
||||
case '\u2265': return 0xB3;
|
||||
case '\u2206': return 0xB4;
|
||||
case '\u00B5': return 0xB5;
|
||||
case '\u2202': return 0xB6;
|
||||
case '\u2211': return 0xB7;
|
||||
case '\u220F': return 0xB8;
|
||||
case '\u0161': return 0xB9;
|
||||
case '\u222B': return 0xBA;
|
||||
case '\u00AA': return 0xBB;
|
||||
case '\u00BA': return 0xBC;
|
||||
case '\u03A9': return 0xBD;
|
||||
case '\u017E': return 0xBE;
|
||||
case '\u00F8': return 0xBF;
|
||||
case '\u00BF': return 0xC0;
|
||||
case '\u00A1': return 0xC1;
|
||||
case '\u00AC': return 0xC2;
|
||||
case '\u221A': return 0xC3;
|
||||
case '\u0192': return 0xC4;
|
||||
case '\u2248': return 0xC5;
|
||||
case '\u0106': return 0xC6;
|
||||
case '\u00AB': return 0xC7;
|
||||
case '\u010C': return 0xC8;
|
||||
case '\u2026': return 0xC9;
|
||||
case '\u00A0': return 0xCA;
|
||||
case '\u00C0': return 0xCB;
|
||||
case '\u00C3': return 0xCC;
|
||||
case '\u00D5': return 0xCD;
|
||||
case '\u0152': return 0xCE;
|
||||
case '\u0153': return 0xCF;
|
||||
case '\u0110': return 0xD0;
|
||||
case '\u2014': return 0xD1;
|
||||
case '\u201C': return 0xD2;
|
||||
case '\u201D': return 0xD3;
|
||||
case '\u2018': return 0xD4;
|
||||
case '\u2019': return 0xD5;
|
||||
case '\u00F7': return 0xD6;
|
||||
case '\u25CA': return 0xD7;
|
||||
case '\uF8FF': return 0xD8;
|
||||
case '\u00A9': return 0xD9;
|
||||
case '\u2044': return 0xDA;
|
||||
case '\u20AC': return 0xDB;
|
||||
case '\u2039': return 0xDC;
|
||||
case '\u203A': return 0xDD;
|
||||
case '\u00C6': return 0xDE;
|
||||
case '\u00BB': return 0xDF;
|
||||
case '\u2013': return 0xE0;
|
||||
case '\u00B7': return 0xE1;
|
||||
case '\u201A': return 0xE2;
|
||||
case '\u201E': return 0xE3;
|
||||
case '\u2030': return 0xE4;
|
||||
case '\u00C2': return 0xE5;
|
||||
case '\u0107': return 0xE6;
|
||||
case '\u00C1': return 0xE7;
|
||||
case '\u010D': return 0xE8;
|
||||
case '\u00C8': return 0xE9;
|
||||
case '\u00CD': return 0xEA;
|
||||
case '\u00CE': return 0xEB;
|
||||
case '\u00CF': return 0xEC;
|
||||
case '\u00CC': return 0xED;
|
||||
case '\u00D3': return 0xEE;
|
||||
case '\u00D4': return 0xEF;
|
||||
case '\u0111': return 0xF0;
|
||||
case '\u00D2': return 0xF1;
|
||||
case '\u00DA': return 0xF2;
|
||||
case '\u00DB': return 0xF3;
|
||||
case '\u00D9': return 0xF4;
|
||||
case '\u0131': return 0xF5;
|
||||
case '\u02C6': return 0xF6;
|
||||
case '\u02DC': return 0xF7;
|
||||
case '\u00AF': return 0xF8;
|
||||
case '\u03C0': return 0xF9;
|
||||
case '\u00CB': return 0xFA;
|
||||
case '\u02DA': return 0xFB;
|
||||
case '\u00B8': return 0xFC;
|
||||
case '\u00CA': return 0xFD;
|
||||
case '\u00E6': return 0xFE;
|
||||
case '\u02C7': return 0xFF;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u2318' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u2713' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u25C6' => 0x13,
|
||||
'\u0014' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u007F' => 0x7F,
|
||||
'\u00C4' => 0x80,
|
||||
'\u00C5' => 0x81,
|
||||
'\u00C7' => 0x82,
|
||||
'\u00C9' => 0x83,
|
||||
'\u00D1' => 0x84,
|
||||
'\u00D6' => 0x85,
|
||||
'\u00DC' => 0x86,
|
||||
'\u00E1' => 0x87,
|
||||
'\u00E0' => 0x88,
|
||||
'\u00E2' => 0x89,
|
||||
'\u00E4' => 0x8A,
|
||||
'\u00E3' => 0x8B,
|
||||
'\u00E5' => 0x8C,
|
||||
'\u00E7' => 0x8D,
|
||||
'\u00E9' => 0x8E,
|
||||
'\u00E8' => 0x8F,
|
||||
'\u00EA' => 0x90,
|
||||
'\u00EB' => 0x91,
|
||||
'\u00ED' => 0x92,
|
||||
'\u00EC' => 0x93,
|
||||
'\u00EE' => 0x94,
|
||||
'\u00EF' => 0x95,
|
||||
'\u00F1' => 0x96,
|
||||
'\u00F3' => 0x97,
|
||||
'\u00F2' => 0x98,
|
||||
'\u00F4' => 0x99,
|
||||
'\u00F6' => 0x9A,
|
||||
'\u00F5' => 0x9B,
|
||||
'\u00FA' => 0x9C,
|
||||
'\u00F9' => 0x9D,
|
||||
'\u00FB' => 0x9E,
|
||||
'\u00FC' => 0x9F,
|
||||
'\u2020' => 0xA0,
|
||||
'\u00B0' => 0xA1,
|
||||
'\u00A2' => 0xA2,
|
||||
'\u00A3' => 0xA3,
|
||||
'\u00A7' => 0xA4,
|
||||
'\u2022' => 0xA5,
|
||||
'\u00B6' => 0xA6,
|
||||
'\u00DF' => 0xA7,
|
||||
'\u00AE' => 0xA8,
|
||||
'\u0160' => 0xA9,
|
||||
'\u2122' => 0xAA,
|
||||
'\u00B4' => 0xAB,
|
||||
'\u00A8' => 0xAC,
|
||||
'\u2260' => 0xAD,
|
||||
'\u017D' => 0xAE,
|
||||
'\u00D8' => 0xAF,
|
||||
'\u221E' => 0xB0,
|
||||
'\u00B1' => 0xB1,
|
||||
'\u2264' => 0xB2,
|
||||
'\u2265' => 0xB3,
|
||||
'\u2206' => 0xB4,
|
||||
'\u00B5' => 0xB5,
|
||||
'\u2202' => 0xB6,
|
||||
'\u2211' => 0xB7,
|
||||
'\u220F' => 0xB8,
|
||||
'\u0161' => 0xB9,
|
||||
'\u222B' => 0xBA,
|
||||
'\u00AA' => 0xBB,
|
||||
'\u00BA' => 0xBC,
|
||||
'\u03A9' => 0xBD,
|
||||
'\u017E' => 0xBE,
|
||||
'\u00F8' => 0xBF,
|
||||
'\u00BF' => 0xC0,
|
||||
'\u00A1' => 0xC1,
|
||||
'\u00AC' => 0xC2,
|
||||
'\u221A' => 0xC3,
|
||||
'\u0192' => 0xC4,
|
||||
'\u2248' => 0xC5,
|
||||
'\u0106' => 0xC6,
|
||||
'\u00AB' => 0xC7,
|
||||
'\u010C' => 0xC8,
|
||||
'\u2026' => 0xC9,
|
||||
'\u00A0' => 0xCA,
|
||||
'\u00C0' => 0xCB,
|
||||
'\u00C3' => 0xCC,
|
||||
'\u00D5' => 0xCD,
|
||||
'\u0152' => 0xCE,
|
||||
'\u0153' => 0xCF,
|
||||
'\u0110' => 0xD0,
|
||||
'\u2014' => 0xD1,
|
||||
'\u201C' => 0xD2,
|
||||
'\u201D' => 0xD3,
|
||||
'\u2018' => 0xD4,
|
||||
'\u2019' => 0xD5,
|
||||
'\u00F7' => 0xD6,
|
||||
'\u25CA' => 0xD7,
|
||||
'\uF8FF' => 0xD8,
|
||||
'\u00A9' => 0xD9,
|
||||
'\u2044' => 0xDA,
|
||||
'\u20AC' => 0xDB,
|
||||
'\u2039' => 0xDC,
|
||||
'\u203A' => 0xDD,
|
||||
'\u00C6' => 0xDE,
|
||||
'\u00BB' => 0xDF,
|
||||
'\u2013' => 0xE0,
|
||||
'\u00B7' => 0xE1,
|
||||
'\u201A' => 0xE2,
|
||||
'\u201E' => 0xE3,
|
||||
'\u2030' => 0xE4,
|
||||
'\u00C2' => 0xE5,
|
||||
'\u0107' => 0xE6,
|
||||
'\u00C1' => 0xE7,
|
||||
'\u010D' => 0xE8,
|
||||
'\u00C8' => 0xE9,
|
||||
'\u00CD' => 0xEA,
|
||||
'\u00CE' => 0xEB,
|
||||
'\u00CF' => 0xEC,
|
||||
'\u00CC' => 0xED,
|
||||
'\u00D3' => 0xEE,
|
||||
'\u00D4' => 0xEF,
|
||||
'\u0111' => 0xF0,
|
||||
'\u00D2' => 0xF1,
|
||||
'\u00DA' => 0xF2,
|
||||
'\u00DB' => 0xF3,
|
||||
'\u00D9' => 0xF4,
|
||||
'\u0131' => 0xF5,
|
||||
'\u02C6' => 0xF6,
|
||||
'\u02DC' => 0xF7,
|
||||
'\u00AF' => 0xF8,
|
||||
'\u03C0' => 0xF9,
|
||||
'\u00CB' => 0xFA,
|
||||
'\u02DA' => 0xFB,
|
||||
'\u00B8' => 0xFC,
|
||||
'\u00CA' => 0xFD,
|
||||
'\u00E6' => 0xFE,
|
||||
'\u02C7' => 0xFF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Mac Cyrillic character encoding of Unicode characters.</summary>
|
||||
public class MacCyrillic : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "x-mac-cyrillic";
|
||||
public override int CodePage => 10007;
|
||||
public override string EncodingName => "Cyrillic (Mac)";
|
||||
public override string HeaderName => "x-mac-cyrillic";
|
||||
public override string WebName => "x-mac-cyrillic";
|
||||
public override int WindowsCodePage => 10007;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "x-mac-cyrillic";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 10007;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Cyrillic (Mac)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "x-mac-cyrillic";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "x-mac-cyrillic";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 10007;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Macintosh Cyrillic to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -53,7 +65,7 @@ namespace Claunia.Encoding
|
||||
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
|
||||
|
||||
// 0x10
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
|
||||
'\u0010', '\u2318', '\u2713', '\u25C6', '\uF8FF', '\u0015', '\u0016', '\u0017',
|
||||
|
||||
// 0x18
|
||||
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
|
||||
@@ -146,270 +158,268 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an Mac Cyrillic character</summary>
|
||||
/// <returns>Mac Cyrillic character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u0410': return 0x80;
|
||||
case '\u0411': return 0x81;
|
||||
case '\u0412': return 0x82;
|
||||
case '\u0413': return 0x83;
|
||||
case '\u0414': return 0x84;
|
||||
case '\u0415': return 0x85;
|
||||
case '\u0416': return 0x86;
|
||||
case '\u0417': return 0x87;
|
||||
case '\u0418': return 0x88;
|
||||
case '\u0419': return 0x89;
|
||||
case '\u041A': return 0x8A;
|
||||
case '\u041B': return 0x8B;
|
||||
case '\u041C': return 0x8C;
|
||||
case '\u041D': return 0x8D;
|
||||
case '\u041E': return 0x8E;
|
||||
case '\u041F': return 0x8F;
|
||||
case '\u0420': return 0x90;
|
||||
case '\u0421': return 0x91;
|
||||
case '\u0422': return 0x92;
|
||||
case '\u0423': return 0x93;
|
||||
case '\u0424': return 0x94;
|
||||
case '\u0425': return 0x95;
|
||||
case '\u0426': return 0x96;
|
||||
case '\u0427': return 0x97;
|
||||
case '\u0428': return 0x98;
|
||||
case '\u0429': return 0x99;
|
||||
case '\u042A': return 0x9A;
|
||||
case '\u042B': return 0x9B;
|
||||
case '\u042C': return 0x9C;
|
||||
case '\u042D': return 0x9D;
|
||||
case '\u042E': return 0x9E;
|
||||
case '\u042F': return 0x9F;
|
||||
case '\u2020': return 0xA0;
|
||||
case '\u00B0': return 0xA1;
|
||||
case '\u0490': return 0xA2;
|
||||
case '\u00A3': return 0xA3;
|
||||
case '\u00A7': return 0xA4;
|
||||
case '\u2022': return 0xA5;
|
||||
case '\u00B6': return 0xA6;
|
||||
case '\u0406': return 0xA7;
|
||||
case '\u00AE': return 0xA8;
|
||||
case '\u00A9': return 0xA9;
|
||||
case '\u2122': return 0xAA;
|
||||
case '\u0402': return 0xAB;
|
||||
case '\u0452': return 0xAC;
|
||||
case '\u2260': return 0xAD;
|
||||
case '\u0403': return 0xAE;
|
||||
case '\u0453': return 0xAF;
|
||||
case '\u221E': return 0xB0;
|
||||
case '\u00B1': return 0xB1;
|
||||
case '\u2264': return 0xB2;
|
||||
case '\u2265': return 0xB3;
|
||||
case '\u0456': return 0xB4;
|
||||
case '\u00B5': return 0xB5;
|
||||
case '\u0491': return 0xB6;
|
||||
case '\u0408': return 0xB7;
|
||||
case '\u0404': return 0xB8;
|
||||
case '\u0454': return 0xB9;
|
||||
case '\u0407': return 0xBA;
|
||||
case '\u0457': return 0xBB;
|
||||
case '\u0409': return 0xBC;
|
||||
case '\u0459': return 0xBD;
|
||||
case '\u040A': return 0xBE;
|
||||
case '\u045A': return 0xBF;
|
||||
case '\u0458': return 0xC0;
|
||||
case '\u0405': return 0xC1;
|
||||
case '\u00AC': return 0xC2;
|
||||
case '\u221A': return 0xC3;
|
||||
case '\u0192': return 0xC4;
|
||||
case '\u2248': return 0xC5;
|
||||
case '\u2206': return 0xC6;
|
||||
case '\u00AB': return 0xC7;
|
||||
case '\u00BB': return 0xC8;
|
||||
case '\u2026': return 0xC9;
|
||||
case '\u00A0': return 0xCA;
|
||||
case '\u040B': return 0xCB;
|
||||
case '\u045B': return 0xCC;
|
||||
case '\u040C': return 0xCD;
|
||||
case '\u045C': return 0xCE;
|
||||
case '\u0455': return 0xCF;
|
||||
case '\u2013': return 0xD0;
|
||||
case '\u2014': return 0xD1;
|
||||
case '\u201C': return 0xD2;
|
||||
case '\u201D': return 0xD3;
|
||||
case '\u2018': return 0xD4;
|
||||
case '\u2019': return 0xD5;
|
||||
case '\u00F7': return 0xD6;
|
||||
case '\u201E': return 0xD7;
|
||||
case '\u040E': return 0xD8;
|
||||
case '\u045E': return 0xD9;
|
||||
case '\u040F': return 0xDA;
|
||||
case '\u045F': return 0xDB;
|
||||
case '\u2116': return 0xDC;
|
||||
case '\u0401': return 0xDD;
|
||||
case '\u0451': return 0xDE;
|
||||
case '\u044F': return 0xDF;
|
||||
case '\u0430': return 0xE0;
|
||||
case '\u0431': return 0xE1;
|
||||
case '\u0432': return 0xE2;
|
||||
case '\u0433': return 0xE3;
|
||||
case '\u0434': return 0xE4;
|
||||
case '\u0435': return 0xE5;
|
||||
case '\u0436': return 0xE6;
|
||||
case '\u0437': return 0xE7;
|
||||
case '\u0438': return 0xE8;
|
||||
case '\u0439': return 0xE9;
|
||||
case '\u043A': return 0xEA;
|
||||
case '\u043B': return 0xEB;
|
||||
case '\u043C': return 0xEC;
|
||||
case '\u043D': return 0xED;
|
||||
case '\u043E': return 0xEE;
|
||||
case '\u043F': return 0xEF;
|
||||
case '\u0440': return 0xF0;
|
||||
case '\u0441': return 0xF1;
|
||||
case '\u0442': return 0xF2;
|
||||
case '\u0443': return 0xF3;
|
||||
case '\u0444': return 0xF4;
|
||||
case '\u0445': return 0xF5;
|
||||
case '\u0446': return 0xF6;
|
||||
case '\u0447': return 0xF7;
|
||||
case '\u0448': return 0xF8;
|
||||
case '\u0449': return 0xF9;
|
||||
case '\u044A': return 0xFA;
|
||||
case '\u044B': return 0xFB;
|
||||
case '\u044C': return 0xFC;
|
||||
case '\u044D': return 0xFD;
|
||||
case '\u044E': return 0xFE;
|
||||
case '\u20AC': return 0xFF;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u2318' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u2713' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u25C6' => 0x13,
|
||||
'\u0014' => 0x14,
|
||||
'\uF8FF' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u007F' => 0x7F,
|
||||
'\u0410' => 0x80,
|
||||
'\u0411' => 0x81,
|
||||
'\u0412' => 0x82,
|
||||
'\u0413' => 0x83,
|
||||
'\u0414' => 0x84,
|
||||
'\u0415' => 0x85,
|
||||
'\u0416' => 0x86,
|
||||
'\u0417' => 0x87,
|
||||
'\u0418' => 0x88,
|
||||
'\u0419' => 0x89,
|
||||
'\u041A' => 0x8A,
|
||||
'\u041B' => 0x8B,
|
||||
'\u041C' => 0x8C,
|
||||
'\u041D' => 0x8D,
|
||||
'\u041E' => 0x8E,
|
||||
'\u041F' => 0x8F,
|
||||
'\u0420' => 0x90,
|
||||
'\u0421' => 0x91,
|
||||
'\u0422' => 0x92,
|
||||
'\u0423' => 0x93,
|
||||
'\u0424' => 0x94,
|
||||
'\u0425' => 0x95,
|
||||
'\u0426' => 0x96,
|
||||
'\u0427' => 0x97,
|
||||
'\u0428' => 0x98,
|
||||
'\u0429' => 0x99,
|
||||
'\u042A' => 0x9A,
|
||||
'\u042B' => 0x9B,
|
||||
'\u042C' => 0x9C,
|
||||
'\u042D' => 0x9D,
|
||||
'\u042E' => 0x9E,
|
||||
'\u042F' => 0x9F,
|
||||
'\u2020' => 0xA0,
|
||||
'\u00B0' => 0xA1,
|
||||
'\u0490' => 0xA2,
|
||||
'\u00A3' => 0xA3,
|
||||
'\u00A7' => 0xA4,
|
||||
'\u2022' => 0xA5,
|
||||
'\u00B6' => 0xA6,
|
||||
'\u0406' => 0xA7,
|
||||
'\u00AE' => 0xA8,
|
||||
'\u00A9' => 0xA9,
|
||||
'\u2122' => 0xAA,
|
||||
'\u0402' => 0xAB,
|
||||
'\u0452' => 0xAC,
|
||||
'\u2260' => 0xAD,
|
||||
'\u0403' => 0xAE,
|
||||
'\u0453' => 0xAF,
|
||||
'\u221E' => 0xB0,
|
||||
'\u00B1' => 0xB1,
|
||||
'\u2264' => 0xB2,
|
||||
'\u2265' => 0xB3,
|
||||
'\u0456' => 0xB4,
|
||||
'\u00B5' => 0xB5,
|
||||
'\u0491' => 0xB6,
|
||||
'\u0408' => 0xB7,
|
||||
'\u0404' => 0xB8,
|
||||
'\u0454' => 0xB9,
|
||||
'\u0407' => 0xBA,
|
||||
'\u0457' => 0xBB,
|
||||
'\u0409' => 0xBC,
|
||||
'\u0459' => 0xBD,
|
||||
'\u040A' => 0xBE,
|
||||
'\u045A' => 0xBF,
|
||||
'\u0458' => 0xC0,
|
||||
'\u0405' => 0xC1,
|
||||
'\u00AC' => 0xC2,
|
||||
'\u221A' => 0xC3,
|
||||
'\u0192' => 0xC4,
|
||||
'\u2248' => 0xC5,
|
||||
'\u2206' => 0xC6,
|
||||
'\u00AB' => 0xC7,
|
||||
'\u00BB' => 0xC8,
|
||||
'\u2026' => 0xC9,
|
||||
'\u00A0' => 0xCA,
|
||||
'\u040B' => 0xCB,
|
||||
'\u045B' => 0xCC,
|
||||
'\u040C' => 0xCD,
|
||||
'\u045C' => 0xCE,
|
||||
'\u0455' => 0xCF,
|
||||
'\u2013' => 0xD0,
|
||||
'\u2014' => 0xD1,
|
||||
'\u201C' => 0xD2,
|
||||
'\u201D' => 0xD3,
|
||||
'\u2018' => 0xD4,
|
||||
'\u2019' => 0xD5,
|
||||
'\u00F7' => 0xD6,
|
||||
'\u201E' => 0xD7,
|
||||
'\u040E' => 0xD8,
|
||||
'\u045E' => 0xD9,
|
||||
'\u040F' => 0xDA,
|
||||
'\u045F' => 0xDB,
|
||||
'\u2116' => 0xDC,
|
||||
'\u0401' => 0xDD,
|
||||
'\u0451' => 0xDE,
|
||||
'\u044F' => 0xDF,
|
||||
'\u0430' => 0xE0,
|
||||
'\u0431' => 0xE1,
|
||||
'\u0432' => 0xE2,
|
||||
'\u0433' => 0xE3,
|
||||
'\u0434' => 0xE4,
|
||||
'\u0435' => 0xE5,
|
||||
'\u0436' => 0xE6,
|
||||
'\u0437' => 0xE7,
|
||||
'\u0438' => 0xE8,
|
||||
'\u0439' => 0xE9,
|
||||
'\u043A' => 0xEA,
|
||||
'\u043B' => 0xEB,
|
||||
'\u043C' => 0xEC,
|
||||
'\u043D' => 0xED,
|
||||
'\u043E' => 0xEE,
|
||||
'\u043F' => 0xEF,
|
||||
'\u0440' => 0xF0,
|
||||
'\u0441' => 0xF1,
|
||||
'\u0442' => 0xF2,
|
||||
'\u0443' => 0xF3,
|
||||
'\u0444' => 0xF4,
|
||||
'\u0445' => 0xF5,
|
||||
'\u0446' => 0xF6,
|
||||
'\u0447' => 0xF7,
|
||||
'\u0448' => 0xF8,
|
||||
'\u0449' => 0xF9,
|
||||
'\u044A' => 0xFA,
|
||||
'\u044B' => 0xFB,
|
||||
'\u044C' => 0xFC,
|
||||
'\u044D' => 0xFD,
|
||||
'\u044E' => 0xFE,
|
||||
'\u20AC' => 0xFF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Mac Farsi character encoding of Unicode characters.</summary>
|
||||
public class MacFarsi : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "x-mac-farsi";
|
||||
public override int CodePage => 10014;
|
||||
public override string EncodingName => "Farsi (Mac)";
|
||||
public override string HeaderName => "x-mac-farsi";
|
||||
public override string WebName => "x-mac-farsi";
|
||||
public override int WindowsCodePage => 10014;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "x-mac-farsi";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 10014;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Farsi (Mac)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "x-mac-farsi";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "x-mac-farsi";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 10014;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Macintosh Farsi to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -53,7 +65,7 @@ namespace Claunia.Encoding
|
||||
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
|
||||
|
||||
// 0x10
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
|
||||
'\u0010', '\u2318', '\u2713', '\u25C6', '\uF8FF', '\u0015', '\u0016', '\u0017',
|
||||
|
||||
// 0x18
|
||||
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
|
||||
@@ -146,244 +158,242 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an Mac Farsi character</summary>
|
||||
/// <returns>Mac Farsi character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u00C4': return 0x80;
|
||||
case '\u00A0': return 0x81;
|
||||
case '\u00C7': return 0x82;
|
||||
case '\u00C9': return 0x83;
|
||||
case '\u00D1': return 0x84;
|
||||
case '\u00D6': return 0x85;
|
||||
case '\u00DC': return 0x86;
|
||||
case '\u00E1': return 0x87;
|
||||
case '\u00E0': return 0x88;
|
||||
case '\u00E2': return 0x89;
|
||||
case '\u00E4': return 0x8A;
|
||||
case '\u06BA': return 0x8B;
|
||||
case '\u00AB': return 0x8C;
|
||||
case '\u00E7': return 0x8D;
|
||||
case '\u00E9': return 0x8E;
|
||||
case '\u00E8': return 0x8F;
|
||||
case '\u00EA': return 0x90;
|
||||
case '\u00EB': return 0x91;
|
||||
case '\u00ED': return 0x92;
|
||||
case '\u2026': return 0x93;
|
||||
case '\u00EE': return 0x94;
|
||||
case '\u00EF': return 0x95;
|
||||
case '\u00F1': return 0x96;
|
||||
case '\u00F3': return 0x97;
|
||||
case '\u00BB': return 0x98;
|
||||
case '\u00F4': return 0x99;
|
||||
case '\u00F6': return 0x9A;
|
||||
case '\u00F7': return 0x9B;
|
||||
case '\u00FA': return 0x9C;
|
||||
case '\u00F9': return 0x9D;
|
||||
case '\u00FB': return 0x9E;
|
||||
case '\u00FC': return 0x9F;
|
||||
case '\u066A': return 0xA5;
|
||||
case '\u060C': return 0xAC;
|
||||
case '\u06F0': return 0xB0;
|
||||
case '\u06F1': return 0xB1;
|
||||
case '\u06F2': return 0xB2;
|
||||
case '\u06F3': return 0xB3;
|
||||
case '\u06F4': return 0xB4;
|
||||
case '\u06F5': return 0xB5;
|
||||
case '\u06F6': return 0xB6;
|
||||
case '\u06F7': return 0xB7;
|
||||
case '\u06F8': return 0xB8;
|
||||
case '\u06F9': return 0xB9;
|
||||
case '\u061B': return 0xBB;
|
||||
case '\u061F': return 0xBF;
|
||||
case '\u274A': return 0xC0;
|
||||
case '\u0621': return 0xC1;
|
||||
case '\u0622': return 0xC2;
|
||||
case '\u0623': return 0xC3;
|
||||
case '\u0624': return 0xC4;
|
||||
case '\u0625': return 0xC5;
|
||||
case '\u0626': return 0xC6;
|
||||
case '\u0627': return 0xC7;
|
||||
case '\u0628': return 0xC8;
|
||||
case '\u0629': return 0xC9;
|
||||
case '\u062A': return 0xCA;
|
||||
case '\u062B': return 0xCB;
|
||||
case '\u062C': return 0xCC;
|
||||
case '\u062D': return 0xCD;
|
||||
case '\u062E': return 0xCE;
|
||||
case '\u062F': return 0xCF;
|
||||
case '\u0630': return 0xD0;
|
||||
case '\u0631': return 0xD1;
|
||||
case '\u0632': return 0xD2;
|
||||
case '\u0633': return 0xD3;
|
||||
case '\u0634': return 0xD4;
|
||||
case '\u0635': return 0xD5;
|
||||
case '\u0636': return 0xD6;
|
||||
case '\u0637': return 0xD7;
|
||||
case '\u0638': return 0xD8;
|
||||
case '\u0639': return 0xD9;
|
||||
case '\u063A': return 0xDA;
|
||||
case '\u0640': return 0xE0;
|
||||
case '\u0641': return 0xE1;
|
||||
case '\u0642': return 0xE2;
|
||||
case '\u0643': return 0xE3;
|
||||
case '\u0644': return 0xE4;
|
||||
case '\u0645': return 0xE5;
|
||||
case '\u0646': return 0xE6;
|
||||
case '\u0647': return 0xE7;
|
||||
case '\u0648': return 0xE8;
|
||||
case '\u0649': return 0xE9;
|
||||
case '\u064A': return 0xEA;
|
||||
case '\u064B': return 0xEB;
|
||||
case '\u064C': return 0xEC;
|
||||
case '\u064D': return 0xED;
|
||||
case '\u064E': return 0xEE;
|
||||
case '\u064F': return 0xEF;
|
||||
case '\u0650': return 0xF0;
|
||||
case '\u0651': return 0xF1;
|
||||
case '\u0652': return 0xF2;
|
||||
case '\u067E': return 0xF3;
|
||||
case '\u0679': return 0xF4;
|
||||
case '\u0686': return 0xF5;
|
||||
case '\u06D5': return 0xF6;
|
||||
case '\u06A4': return 0xF7;
|
||||
case '\u06AF': return 0xF8;
|
||||
case '\u0688': return 0xF9;
|
||||
case '\u0691': return 0xFA;
|
||||
case '\u0698': return 0xFE;
|
||||
case '\u06D2': return 0xFF;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u2318' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u2713' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u25C6' => 0x13,
|
||||
'\uF8FF' => 0x14,
|
||||
'\u0014' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u007F' => 0x7F,
|
||||
'\u00C4' => 0x80,
|
||||
'\u00A0' => 0x81,
|
||||
'\u00C7' => 0x82,
|
||||
'\u00C9' => 0x83,
|
||||
'\u00D1' => 0x84,
|
||||
'\u00D6' => 0x85,
|
||||
'\u00DC' => 0x86,
|
||||
'\u00E1' => 0x87,
|
||||
'\u00E0' => 0x88,
|
||||
'\u00E2' => 0x89,
|
||||
'\u00E4' => 0x8A,
|
||||
'\u06BA' => 0x8B,
|
||||
'\u00AB' => 0x8C,
|
||||
'\u00E7' => 0x8D,
|
||||
'\u00E9' => 0x8E,
|
||||
'\u00E8' => 0x8F,
|
||||
'\u00EA' => 0x90,
|
||||
'\u00EB' => 0x91,
|
||||
'\u00ED' => 0x92,
|
||||
'\u2026' => 0x93,
|
||||
'\u00EE' => 0x94,
|
||||
'\u00EF' => 0x95,
|
||||
'\u00F1' => 0x96,
|
||||
'\u00F3' => 0x97,
|
||||
'\u00BB' => 0x98,
|
||||
'\u00F4' => 0x99,
|
||||
'\u00F6' => 0x9A,
|
||||
'\u00F7' => 0x9B,
|
||||
'\u00FA' => 0x9C,
|
||||
'\u00F9' => 0x9D,
|
||||
'\u00FB' => 0x9E,
|
||||
'\u00FC' => 0x9F,
|
||||
'\u066A' => 0xA5,
|
||||
'\u060C' => 0xAC,
|
||||
'\u06F0' => 0xB0,
|
||||
'\u06F1' => 0xB1,
|
||||
'\u06F2' => 0xB2,
|
||||
'\u06F3' => 0xB3,
|
||||
'\u06F4' => 0xB4,
|
||||
'\u06F5' => 0xB5,
|
||||
'\u06F6' => 0xB6,
|
||||
'\u06F7' => 0xB7,
|
||||
'\u06F8' => 0xB8,
|
||||
'\u06F9' => 0xB9,
|
||||
'\u061B' => 0xBB,
|
||||
'\u061F' => 0xBF,
|
||||
'\u274A' => 0xC0,
|
||||
'\u0621' => 0xC1,
|
||||
'\u0622' => 0xC2,
|
||||
'\u0623' => 0xC3,
|
||||
'\u0624' => 0xC4,
|
||||
'\u0625' => 0xC5,
|
||||
'\u0626' => 0xC6,
|
||||
'\u0627' => 0xC7,
|
||||
'\u0628' => 0xC8,
|
||||
'\u0629' => 0xC9,
|
||||
'\u062A' => 0xCA,
|
||||
'\u062B' => 0xCB,
|
||||
'\u062C' => 0xCC,
|
||||
'\u062D' => 0xCD,
|
||||
'\u062E' => 0xCE,
|
||||
'\u062F' => 0xCF,
|
||||
'\u0630' => 0xD0,
|
||||
'\u0631' => 0xD1,
|
||||
'\u0632' => 0xD2,
|
||||
'\u0633' => 0xD3,
|
||||
'\u0634' => 0xD4,
|
||||
'\u0635' => 0xD5,
|
||||
'\u0636' => 0xD6,
|
||||
'\u0637' => 0xD7,
|
||||
'\u0638' => 0xD8,
|
||||
'\u0639' => 0xD9,
|
||||
'\u063A' => 0xDA,
|
||||
'\u0640' => 0xE0,
|
||||
'\u0641' => 0xE1,
|
||||
'\u0642' => 0xE2,
|
||||
'\u0643' => 0xE3,
|
||||
'\u0644' => 0xE4,
|
||||
'\u0645' => 0xE5,
|
||||
'\u0646' => 0xE6,
|
||||
'\u0647' => 0xE7,
|
||||
'\u0648' => 0xE8,
|
||||
'\u0649' => 0xE9,
|
||||
'\u064A' => 0xEA,
|
||||
'\u064B' => 0xEB,
|
||||
'\u064C' => 0xEC,
|
||||
'\u064D' => 0xED,
|
||||
'\u064E' => 0xEE,
|
||||
'\u064F' => 0xEF,
|
||||
'\u0650' => 0xF0,
|
||||
'\u0651' => 0xF1,
|
||||
'\u0652' => 0xF2,
|
||||
'\u067E' => 0xF3,
|
||||
'\u0679' => 0xF4,
|
||||
'\u0686' => 0xF5,
|
||||
'\u06D5' => 0xF6,
|
||||
'\u06A4' => 0xF7,
|
||||
'\u06AF' => 0xF8,
|
||||
'\u0688' => 0xF9,
|
||||
'\u0691' => 0xFA,
|
||||
'\u0698' => 0xFE,
|
||||
'\u06D2' => 0xFF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Mac Greek character encoding of Unicode characters.</summary>
|
||||
public class MacGreek : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "x-mac-greek";
|
||||
public override int CodePage => 10006;
|
||||
public override string EncodingName => "Greek (Mac)";
|
||||
public override string HeaderName => "x-mac-greek";
|
||||
public override string WebName => "x-mac-greek";
|
||||
public override int WindowsCodePage => 10006;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "x-mac-greek";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 10006;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Greek (Mac)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "x-mac-greek";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "x-mac-greek";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 10006;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Macintosh Greek to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -53,7 +65,7 @@ namespace Claunia.Encoding
|
||||
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
|
||||
|
||||
// 0x10
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
|
||||
'\u0010', '\u2318', '\u2713', '\u25C6', '\uF8FF', '\u0015', '\u0016', '\u0017',
|
||||
|
||||
// 0x18
|
||||
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
|
||||
@@ -146,270 +158,268 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an Mac Greek character</summary>
|
||||
/// <returns>Mac Greek character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u00C4': return 0x80;
|
||||
case '\u00B9': return 0x81;
|
||||
case '\u00B2': return 0x82;
|
||||
case '\u00C9': return 0x83;
|
||||
case '\u00B3': return 0x84;
|
||||
case '\u00D6': return 0x85;
|
||||
case '\u00DC': return 0x86;
|
||||
case '\u0385': return 0x87;
|
||||
case '\u00E0': return 0x88;
|
||||
case '\u00E2': return 0x89;
|
||||
case '\u00E4': return 0x8A;
|
||||
case '\u0384': return 0x8B;
|
||||
case '\u00A8': return 0x8C;
|
||||
case '\u00E7': return 0x8D;
|
||||
case '\u00E9': return 0x8E;
|
||||
case '\u00E8': return 0x8F;
|
||||
case '\u00EA': return 0x90;
|
||||
case '\u00EB': return 0x91;
|
||||
case '\u00A3': return 0x92;
|
||||
case '\u2122': return 0x93;
|
||||
case '\u00EE': return 0x94;
|
||||
case '\u00EF': return 0x95;
|
||||
case '\u2022': return 0x96;
|
||||
case '\u00BD': return 0x97;
|
||||
case '\u2030': return 0x98;
|
||||
case '\u00F4': return 0x99;
|
||||
case '\u00F6': return 0x9A;
|
||||
case '\u00A6': return 0x9B;
|
||||
case '\u20AC': return 0x9C;
|
||||
case '\u00F9': return 0x9D;
|
||||
case '\u00FB': return 0x9E;
|
||||
case '\u00FC': return 0x9F;
|
||||
case '\u2020': return 0xA0;
|
||||
case '\u0393': return 0xA1;
|
||||
case '\u0394': return 0xA2;
|
||||
case '\u0398': return 0xA3;
|
||||
case '\u039B': return 0xA4;
|
||||
case '\u039E': return 0xA5;
|
||||
case '\u03A0': return 0xA6;
|
||||
case '\u00DF': return 0xA7;
|
||||
case '\u00AE': return 0xA8;
|
||||
case '\u00A9': return 0xA9;
|
||||
case '\u03A3': return 0xAA;
|
||||
case '\u03AA': return 0xAB;
|
||||
case '\u00A7': return 0xAC;
|
||||
case '\u2260': return 0xAD;
|
||||
case '\u00B0': return 0xAE;
|
||||
case '\u00B7': return 0xAF;
|
||||
case '\u0391': return 0xB0;
|
||||
case '\u00B1': return 0xB1;
|
||||
case '\u2264': return 0xB2;
|
||||
case '\u2265': return 0xB3;
|
||||
case '\u00A5': return 0xB4;
|
||||
case '\u0392': return 0xB5;
|
||||
case '\u0395': return 0xB6;
|
||||
case '\u0396': return 0xB7;
|
||||
case '\u0397': return 0xB8;
|
||||
case '\u0399': return 0xB9;
|
||||
case '\u039A': return 0xBA;
|
||||
case '\u039C': return 0xBB;
|
||||
case '\u03A6': return 0xBC;
|
||||
case '\u03AB': return 0xBD;
|
||||
case '\u03A8': return 0xBE;
|
||||
case '\u03A9': return 0xBF;
|
||||
case '\u03AC': return 0xC0;
|
||||
case '\u039D': return 0xC1;
|
||||
case '\u00AC': return 0xC2;
|
||||
case '\u039F': return 0xC3;
|
||||
case '\u03A1': return 0xC4;
|
||||
case '\u2248': return 0xC5;
|
||||
case '\u03A4': return 0xC6;
|
||||
case '\u00AB': return 0xC7;
|
||||
case '\u00BB': return 0xC8;
|
||||
case '\u2026': return 0xC9;
|
||||
case '\u00A0': return 0xCA;
|
||||
case '\u03A5': return 0xCB;
|
||||
case '\u03A7': return 0xCC;
|
||||
case '\u0386': return 0xCD;
|
||||
case '\u0388': return 0xCE;
|
||||
case '\u0153': return 0xCF;
|
||||
case '\u2013': return 0xD0;
|
||||
case '\u2015': return 0xD1;
|
||||
case '\u201C': return 0xD2;
|
||||
case '\u201D': return 0xD3;
|
||||
case '\u2018': return 0xD4;
|
||||
case '\u2019': return 0xD5;
|
||||
case '\u00F7': return 0xD6;
|
||||
case '\u0389': return 0xD7;
|
||||
case '\u038A': return 0xD8;
|
||||
case '\u038C': return 0xD9;
|
||||
case '\u038E': return 0xDA;
|
||||
case '\u03AD': return 0xDB;
|
||||
case '\u03AE': return 0xDC;
|
||||
case '\u03AF': return 0xDD;
|
||||
case '\u03CC': return 0xDE;
|
||||
case '\u038F': return 0xDF;
|
||||
case '\u03CD': return 0xE0;
|
||||
case '\u03B1': return 0xE1;
|
||||
case '\u03B2': return 0xE2;
|
||||
case '\u03C8': return 0xE3;
|
||||
case '\u03B4': return 0xE4;
|
||||
case '\u03B5': return 0xE5;
|
||||
case '\u03C6': return 0xE6;
|
||||
case '\u03B3': return 0xE7;
|
||||
case '\u03B7': return 0xE8;
|
||||
case '\u03B9': return 0xE9;
|
||||
case '\u03BE': return 0xEA;
|
||||
case '\u03BA': return 0xEB;
|
||||
case '\u03BB': return 0xEC;
|
||||
case '\u03BC': return 0xED;
|
||||
case '\u03BD': return 0xEE;
|
||||
case '\u03BF': return 0xEF;
|
||||
case '\u03C0': return 0xF0;
|
||||
case '\u03CE': return 0xF1;
|
||||
case '\u03C1': return 0xF2;
|
||||
case '\u03C3': return 0xF3;
|
||||
case '\u03C4': return 0xF4;
|
||||
case '\u03B8': return 0xF5;
|
||||
case '\u03C9': return 0xF6;
|
||||
case '\u03C2': return 0xF7;
|
||||
case '\u03C7': return 0xF8;
|
||||
case '\u03C5': return 0xF9;
|
||||
case '\u03B6': return 0xFA;
|
||||
case '\u03CA': return 0xFB;
|
||||
case '\u03CB': return 0xFC;
|
||||
case '\u0390': return 0xFD;
|
||||
case '\u03B0': return 0xFE;
|
||||
case '\u00AD': return 0xFF;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u2318' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u2713' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u25C6' => 0x13,
|
||||
'\u0014' => 0x14,
|
||||
'\uF8FF' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u007F' => 0x7F,
|
||||
'\u00C4' => 0x80,
|
||||
'\u00B9' => 0x81,
|
||||
'\u00B2' => 0x82,
|
||||
'\u00C9' => 0x83,
|
||||
'\u00B3' => 0x84,
|
||||
'\u00D6' => 0x85,
|
||||
'\u00DC' => 0x86,
|
||||
'\u0385' => 0x87,
|
||||
'\u00E0' => 0x88,
|
||||
'\u00E2' => 0x89,
|
||||
'\u00E4' => 0x8A,
|
||||
'\u0384' => 0x8B,
|
||||
'\u00A8' => 0x8C,
|
||||
'\u00E7' => 0x8D,
|
||||
'\u00E9' => 0x8E,
|
||||
'\u00E8' => 0x8F,
|
||||
'\u00EA' => 0x90,
|
||||
'\u00EB' => 0x91,
|
||||
'\u00A3' => 0x92,
|
||||
'\u2122' => 0x93,
|
||||
'\u00EE' => 0x94,
|
||||
'\u00EF' => 0x95,
|
||||
'\u2022' => 0x96,
|
||||
'\u00BD' => 0x97,
|
||||
'\u2030' => 0x98,
|
||||
'\u00F4' => 0x99,
|
||||
'\u00F6' => 0x9A,
|
||||
'\u00A6' => 0x9B,
|
||||
'\u20AC' => 0x9C,
|
||||
'\u00F9' => 0x9D,
|
||||
'\u00FB' => 0x9E,
|
||||
'\u00FC' => 0x9F,
|
||||
'\u2020' => 0xA0,
|
||||
'\u0393' => 0xA1,
|
||||
'\u0394' => 0xA2,
|
||||
'\u0398' => 0xA3,
|
||||
'\u039B' => 0xA4,
|
||||
'\u039E' => 0xA5,
|
||||
'\u03A0' => 0xA6,
|
||||
'\u00DF' => 0xA7,
|
||||
'\u00AE' => 0xA8,
|
||||
'\u00A9' => 0xA9,
|
||||
'\u03A3' => 0xAA,
|
||||
'\u03AA' => 0xAB,
|
||||
'\u00A7' => 0xAC,
|
||||
'\u2260' => 0xAD,
|
||||
'\u00B0' => 0xAE,
|
||||
'\u00B7' => 0xAF,
|
||||
'\u0391' => 0xB0,
|
||||
'\u00B1' => 0xB1,
|
||||
'\u2264' => 0xB2,
|
||||
'\u2265' => 0xB3,
|
||||
'\u00A5' => 0xB4,
|
||||
'\u0392' => 0xB5,
|
||||
'\u0395' => 0xB6,
|
||||
'\u0396' => 0xB7,
|
||||
'\u0397' => 0xB8,
|
||||
'\u0399' => 0xB9,
|
||||
'\u039A' => 0xBA,
|
||||
'\u039C' => 0xBB,
|
||||
'\u03A6' => 0xBC,
|
||||
'\u03AB' => 0xBD,
|
||||
'\u03A8' => 0xBE,
|
||||
'\u03A9' => 0xBF,
|
||||
'\u03AC' => 0xC0,
|
||||
'\u039D' => 0xC1,
|
||||
'\u00AC' => 0xC2,
|
||||
'\u039F' => 0xC3,
|
||||
'\u03A1' => 0xC4,
|
||||
'\u2248' => 0xC5,
|
||||
'\u03A4' => 0xC6,
|
||||
'\u00AB' => 0xC7,
|
||||
'\u00BB' => 0xC8,
|
||||
'\u2026' => 0xC9,
|
||||
'\u00A0' => 0xCA,
|
||||
'\u03A5' => 0xCB,
|
||||
'\u03A7' => 0xCC,
|
||||
'\u0386' => 0xCD,
|
||||
'\u0388' => 0xCE,
|
||||
'\u0153' => 0xCF,
|
||||
'\u2013' => 0xD0,
|
||||
'\u2015' => 0xD1,
|
||||
'\u201C' => 0xD2,
|
||||
'\u201D' => 0xD3,
|
||||
'\u2018' => 0xD4,
|
||||
'\u2019' => 0xD5,
|
||||
'\u00F7' => 0xD6,
|
||||
'\u0389' => 0xD7,
|
||||
'\u038A' => 0xD8,
|
||||
'\u038C' => 0xD9,
|
||||
'\u038E' => 0xDA,
|
||||
'\u03AD' => 0xDB,
|
||||
'\u03AE' => 0xDC,
|
||||
'\u03AF' => 0xDD,
|
||||
'\u03CC' => 0xDE,
|
||||
'\u038F' => 0xDF,
|
||||
'\u03CD' => 0xE0,
|
||||
'\u03B1' => 0xE1,
|
||||
'\u03B2' => 0xE2,
|
||||
'\u03C8' => 0xE3,
|
||||
'\u03B4' => 0xE4,
|
||||
'\u03B5' => 0xE5,
|
||||
'\u03C6' => 0xE6,
|
||||
'\u03B3' => 0xE7,
|
||||
'\u03B7' => 0xE8,
|
||||
'\u03B9' => 0xE9,
|
||||
'\u03BE' => 0xEA,
|
||||
'\u03BA' => 0xEB,
|
||||
'\u03BB' => 0xEC,
|
||||
'\u03BC' => 0xED,
|
||||
'\u03BD' => 0xEE,
|
||||
'\u03BF' => 0xEF,
|
||||
'\u03C0' => 0xF0,
|
||||
'\u03CE' => 0xF1,
|
||||
'\u03C1' => 0xF2,
|
||||
'\u03C3' => 0xF3,
|
||||
'\u03C4' => 0xF4,
|
||||
'\u03B8' => 0xF5,
|
||||
'\u03C9' => 0xF6,
|
||||
'\u03C2' => 0xF7,
|
||||
'\u03C7' => 0xF8,
|
||||
'\u03C5' => 0xF9,
|
||||
'\u03B6' => 0xFA,
|
||||
'\u03CA' => 0xFB,
|
||||
'\u03CB' => 0xFC,
|
||||
'\u0390' => 0xFD,
|
||||
'\u03B0' => 0xFE,
|
||||
'\u00AD' => 0xFF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Mac Hebrew character encoding of Unicode characters.</summary>
|
||||
public class MacHebrew : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "x-mac-hebrew";
|
||||
public override int CodePage => 10005;
|
||||
public override string EncodingName => "Hebrew (Mac)";
|
||||
public override string HeaderName => "x-mac-hebrew";
|
||||
public override string WebName => "x-mac-hebrew";
|
||||
public override int WindowsCodePage => 10005;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "x-mac-hebrew";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 10005;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Hebrew (Mac)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "x-mac-hebrew";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "x-mac-hebrew";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 10005;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Macintosh Hebrew to Unicode character map.</summary>
|
||||
|
||||
@@ -57,7 +69,7 @@ namespace Claunia.Encoding
|
||||
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
|
||||
|
||||
// 0x10
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\uF8FF', '\u0015', '\u0016', '\u0017',
|
||||
|
||||
// 0x18
|
||||
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
|
||||
@@ -150,231 +162,229 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an Mac Hebrew character</summary>
|
||||
/// <returns>Mac Hebrew character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u00C4': return 0x80;
|
||||
case '\u00C7': return 0x82;
|
||||
case '\u00C9': return 0x83;
|
||||
case '\u00D1': return 0x84;
|
||||
case '\u00D6': return 0x85;
|
||||
case '\u00DC': return 0x86;
|
||||
case '\u00E1': return 0x87;
|
||||
case '\u00E0': return 0x88;
|
||||
case '\u00E2': return 0x89;
|
||||
case '\u00E4': return 0x8A;
|
||||
case '\u00E3': return 0x8B;
|
||||
case '\u00E5': return 0x8C;
|
||||
case '\u00E7': return 0x8D;
|
||||
case '\u00E9': return 0x8E;
|
||||
case '\u00E8': return 0x8F;
|
||||
case '\u00EA': return 0x90;
|
||||
case '\u00EB': return 0x91;
|
||||
case '\u00ED': return 0x92;
|
||||
case '\u00EC': return 0x93;
|
||||
case '\u00EE': return 0x94;
|
||||
case '\u00EF': return 0x95;
|
||||
case '\u00F1': return 0x96;
|
||||
case '\u00F3': return 0x97;
|
||||
case '\u00F2': return 0x98;
|
||||
case '\u00F4': return 0x99;
|
||||
case '\u00F6': return 0x9A;
|
||||
case '\u00F5': return 0x9B;
|
||||
case '\u00FA': return 0x9C;
|
||||
case '\u00F9': return 0x9D;
|
||||
case '\u00FB': return 0x9E;
|
||||
case '\u00FC': return 0x9F;
|
||||
case '\u20AA': return 0xA6;
|
||||
case '\u201E': return 0xC1;
|
||||
case '\uF89B': return 0xC2;
|
||||
case '\uF89C': return 0xC3;
|
||||
case '\uF89D': return 0xC4;
|
||||
case '\uF89E': return 0xC5;
|
||||
case '\u05BC': return 0xC6;
|
||||
case '\uFB4B': return 0xC7;
|
||||
case '\uFB35': return 0xC8;
|
||||
case '\u2026': return 0xC9;
|
||||
case '\u00A0': return 0xCA;
|
||||
case '\u05B8': return 0xCB;
|
||||
case '\u05B7': return 0xCC;
|
||||
case '\u05B5': return 0xCD;
|
||||
case '\u05B6': return 0xCE;
|
||||
case '\u05B4': return 0xCF;
|
||||
case '\u2013': return 0xD0;
|
||||
case '\u2014': return 0xD1;
|
||||
case '\u201C': return 0xD2;
|
||||
case '\u201D': return 0xD3;
|
||||
case '\u2018': return 0xD4;
|
||||
case '\u2019': return 0xD5;
|
||||
case '\uFB2A': return 0xD6;
|
||||
case '\uFB2B': return 0xD7;
|
||||
case '\u05BF': return 0xD8;
|
||||
case '\u05B0': return 0xD9;
|
||||
case '\u05B2': return 0xDA;
|
||||
case '\u05B1': return 0xDB;
|
||||
case '\u05BB': return 0xDC;
|
||||
case '\u05B9': return 0xDD;
|
||||
case '\u05B3': return 0xDF;
|
||||
case '\u05D0': return 0xE0;
|
||||
case '\u05D1': return 0xE1;
|
||||
case '\u05D2': return 0xE2;
|
||||
case '\u05D3': return 0xE3;
|
||||
case '\u05D4': return 0xE4;
|
||||
case '\u05D5': return 0xE5;
|
||||
case '\u05D6': return 0xE6;
|
||||
case '\u05D7': return 0xE7;
|
||||
case '\u05D8': return 0xE8;
|
||||
case '\u05D9': return 0xE9;
|
||||
case '\u05DA': return 0xEA;
|
||||
case '\u05DB': return 0xEB;
|
||||
case '\u05DC': return 0xEC;
|
||||
case '\u05DD': return 0xED;
|
||||
case '\u05DE': return 0xEE;
|
||||
case '\u05DF': return 0xEF;
|
||||
case '\u05E0': return 0xF0;
|
||||
case '\u05E1': return 0xF1;
|
||||
case '\u05E2': return 0xF2;
|
||||
case '\u05E3': return 0xF3;
|
||||
case '\u05E4': return 0xF4;
|
||||
case '\u05E5': return 0xF5;
|
||||
case '\u05E6': return 0xF6;
|
||||
case '\u05E7': return 0xF7;
|
||||
case '\u05E8': return 0xF8;
|
||||
case '\u05E9': return 0xF9;
|
||||
case '\u05EA': return 0xFA;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u2318' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u2713' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u25C6' => 0x13,
|
||||
'\u0014' => 0x14,
|
||||
'\uF8FF' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u007F' => 0x7F,
|
||||
'\u00C4' => 0x80,
|
||||
'\u00C7' => 0x82,
|
||||
'\u00C9' => 0x83,
|
||||
'\u00D1' => 0x84,
|
||||
'\u00D6' => 0x85,
|
||||
'\u00DC' => 0x86,
|
||||
'\u00E1' => 0x87,
|
||||
'\u00E0' => 0x88,
|
||||
'\u00E2' => 0x89,
|
||||
'\u00E4' => 0x8A,
|
||||
'\u00E3' => 0x8B,
|
||||
'\u00E5' => 0x8C,
|
||||
'\u00E7' => 0x8D,
|
||||
'\u00E9' => 0x8E,
|
||||
'\u00E8' => 0x8F,
|
||||
'\u00EA' => 0x90,
|
||||
'\u00EB' => 0x91,
|
||||
'\u00ED' => 0x92,
|
||||
'\u00EC' => 0x93,
|
||||
'\u00EE' => 0x94,
|
||||
'\u00EF' => 0x95,
|
||||
'\u00F1' => 0x96,
|
||||
'\u00F3' => 0x97,
|
||||
'\u00F2' => 0x98,
|
||||
'\u00F4' => 0x99,
|
||||
'\u00F6' => 0x9A,
|
||||
'\u00F5' => 0x9B,
|
||||
'\u00FA' => 0x9C,
|
||||
'\u00F9' => 0x9D,
|
||||
'\u00FB' => 0x9E,
|
||||
'\u00FC' => 0x9F,
|
||||
'\u20AA' => 0xA6,
|
||||
'\u201E' => 0xC1,
|
||||
'\uF89B' => 0xC2,
|
||||
'\uF89C' => 0xC3,
|
||||
'\uF89D' => 0xC4,
|
||||
'\uF89E' => 0xC5,
|
||||
'\u05BC' => 0xC6,
|
||||
'\uFB4B' => 0xC7,
|
||||
'\uFB35' => 0xC8,
|
||||
'\u2026' => 0xC9,
|
||||
'\u00A0' => 0xCA,
|
||||
'\u05B8' => 0xCB,
|
||||
'\u05B7' => 0xCC,
|
||||
'\u05B5' => 0xCD,
|
||||
'\u05B6' => 0xCE,
|
||||
'\u05B4' => 0xCF,
|
||||
'\u2013' => 0xD0,
|
||||
'\u2014' => 0xD1,
|
||||
'\u201C' => 0xD2,
|
||||
'\u201D' => 0xD3,
|
||||
'\u2018' => 0xD4,
|
||||
'\u2019' => 0xD5,
|
||||
'\uFB2A' => 0xD6,
|
||||
'\uFB2B' => 0xD7,
|
||||
'\u05BF' => 0xD8,
|
||||
'\u05B0' => 0xD9,
|
||||
'\u05B2' => 0xDA,
|
||||
'\u05B1' => 0xDB,
|
||||
'\u05BB' => 0xDC,
|
||||
'\u05B9' => 0xDD,
|
||||
'\u05B3' => 0xDF,
|
||||
'\u05D0' => 0xE0,
|
||||
'\u05D1' => 0xE1,
|
||||
'\u05D2' => 0xE2,
|
||||
'\u05D3' => 0xE3,
|
||||
'\u05D4' => 0xE4,
|
||||
'\u05D5' => 0xE5,
|
||||
'\u05D6' => 0xE6,
|
||||
'\u05D7' => 0xE7,
|
||||
'\u05D8' => 0xE8,
|
||||
'\u05D9' => 0xE9,
|
||||
'\u05DA' => 0xEA,
|
||||
'\u05DB' => 0xEB,
|
||||
'\u05DC' => 0xEC,
|
||||
'\u05DD' => 0xED,
|
||||
'\u05DE' => 0xEE,
|
||||
'\u05DF' => 0xEF,
|
||||
'\u05E0' => 0xF0,
|
||||
'\u05E1' => 0xF1,
|
||||
'\u05E2' => 0xF2,
|
||||
'\u05E3' => 0xF3,
|
||||
'\u05E4' => 0xF4,
|
||||
'\u05E5' => 0xF5,
|
||||
'\u05E6' => 0xF6,
|
||||
'\u05E7' => 0xF7,
|
||||
'\u05E8' => 0xF8,
|
||||
'\u05E9' => 0xF9,
|
||||
'\u05EA' => 0xFA,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Apple Mac character encoding of Unicode characters.</summary>
|
||||
public class MacRoman : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "macintosh";
|
||||
public override int CodePage => 10000;
|
||||
public override string EncodingName => "Western European (Mac)";
|
||||
public override string HeaderName => "macintosh";
|
||||
public override string WebName => "macintosh";
|
||||
public override int WindowsCodePage => 10000;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "macintosh";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 10000;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Western European (Mac)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "macintosh";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "macintosh";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 10000;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Mac to Unicode character map. MacRoman is a superset of LisaRoman.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -53,7 +65,7 @@ namespace Claunia.Encoding
|
||||
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
|
||||
|
||||
// 0x10
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
|
||||
'\u0010', '\u2318', '\u2713', '\u25C6', '\uF8FF', '\u0015', '\u0016', '\u0017',
|
||||
|
||||
// 0x18
|
||||
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
|
||||
@@ -146,270 +158,268 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an MacRoman character</summary>
|
||||
/// <returns>MacRoman character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u00C4': return 0x80;
|
||||
case '\u00C5': return 0x81;
|
||||
case '\u00C7': return 0x82;
|
||||
case '\u00C9': return 0x83;
|
||||
case '\u00D1': return 0x84;
|
||||
case '\u00D6': return 0x85;
|
||||
case '\u00DC': return 0x86;
|
||||
case '\u00E1': return 0x87;
|
||||
case '\u00E0': return 0x88;
|
||||
case '\u00E2': return 0x89;
|
||||
case '\u00E4': return 0x8A;
|
||||
case '\u00E3': return 0x8B;
|
||||
case '\u00E5': return 0x8C;
|
||||
case '\u00E7': return 0x8D;
|
||||
case '\u00E9': return 0x8E;
|
||||
case '\u00E8': return 0x8F;
|
||||
case '\u00EA': return 0x90;
|
||||
case '\u00EB': return 0x91;
|
||||
case '\u00ED': return 0x92;
|
||||
case '\u00EC': return 0x93;
|
||||
case '\u00EE': return 0x94;
|
||||
case '\u00EF': return 0x95;
|
||||
case '\u00F1': return 0x96;
|
||||
case '\u00F3': return 0x97;
|
||||
case '\u00F2': return 0x98;
|
||||
case '\u00F4': return 0x99;
|
||||
case '\u00F6': return 0x9A;
|
||||
case '\u00F5': return 0x9B;
|
||||
case '\u00FA': return 0x9C;
|
||||
case '\u00F9': return 0x9D;
|
||||
case '\u00FB': return 0x9E;
|
||||
case '\u00FC': return 0x9F;
|
||||
case '\u2020': return 0xA0;
|
||||
case '\u00B0': return 0xA1;
|
||||
case '\u00A2': return 0xA2;
|
||||
case '\u00A3': return 0xA3;
|
||||
case '\u00A7': return 0xA4;
|
||||
case '\u2022': return 0xA5;
|
||||
case '\u00B6': return 0xA6;
|
||||
case '\u00DF': return 0xA7;
|
||||
case '\u00AE': return 0xA8;
|
||||
case '\u00A9': return 0xA9;
|
||||
case '\u2122': return 0xAA;
|
||||
case '\u00B4': return 0xAB;
|
||||
case '\u00A8': return 0xAC;
|
||||
case '\u2260': return 0xAD;
|
||||
case '\u00C6': return 0xAE;
|
||||
case '\u00D8': return 0xAF;
|
||||
case '\u221E': return 0xB0;
|
||||
case '\u00B1': return 0xB1;
|
||||
case '\u2264': return 0xB2;
|
||||
case '\u2265': return 0xB3;
|
||||
case '\u00A5': return 0xB4;
|
||||
case '\u00B5': return 0xB5;
|
||||
case '\u2202': return 0xB6;
|
||||
case '\u2211': return 0xB7;
|
||||
case '\u220F': return 0xB8;
|
||||
case '\u03C0': return 0xB9;
|
||||
case '\u222B': return 0xBA;
|
||||
case '\u00AA': return 0xBB;
|
||||
case '\u00BA': return 0xBC;
|
||||
case '\u03A9': return 0xBD;
|
||||
case '\u00E6': return 0xBE;
|
||||
case '\u00F8': return 0xBF;
|
||||
case '\u00BF': return 0xC0;
|
||||
case '\u00A1': return 0xC1;
|
||||
case '\u00AC': return 0xC2;
|
||||
case '\u221A': return 0xC3;
|
||||
case '\u0192': return 0xC4;
|
||||
case '\u2248': return 0xC5;
|
||||
case '\u2206': return 0xC6;
|
||||
case '\u00AB': return 0xC7;
|
||||
case '\u00BB': return 0xC8;
|
||||
case '\u2026': return 0xC9;
|
||||
case '\u00A0': return 0xCA;
|
||||
case '\u00C0': return 0xCB;
|
||||
case '\u00C3': return 0xCC;
|
||||
case '\u00D5': return 0xCD;
|
||||
case '\u0152': return 0xCE;
|
||||
case '\u0153': return 0xCF;
|
||||
case '\u2013': return 0xD0;
|
||||
case '\u2014': return 0xD1;
|
||||
case '\u201C': return 0xD2;
|
||||
case '\u201D': return 0xD3;
|
||||
case '\u2018': return 0xD4;
|
||||
case '\u2019': return 0xD5;
|
||||
case '\u00F7': return 0xD6;
|
||||
case '\u25CA': return 0xD7;
|
||||
case '\u00FF': return 0xD8;
|
||||
case '\u0178': return 0xD9;
|
||||
case '\u2044': return 0xDA;
|
||||
case '\u20AC': return 0xDB;
|
||||
case '\u2039': return 0xDC;
|
||||
case '\u203A': return 0xDD;
|
||||
case '\uFB01': return 0xDE;
|
||||
case '\uFB02': return 0xDF;
|
||||
case '\u2021': return 0xE0;
|
||||
case '\u00B7': return 0xE1;
|
||||
case '\u201A': return 0xE2;
|
||||
case '\u201E': return 0xE3;
|
||||
case '\u2030': return 0xE4;
|
||||
case '\u00C2': return 0xE5;
|
||||
case '\u00CA': return 0xE6;
|
||||
case '\u00C1': return 0xE7;
|
||||
case '\u00CB': return 0xE8;
|
||||
case '\u00C8': return 0xE9;
|
||||
case '\u00CD': return 0xEA;
|
||||
case '\u00CE': return 0xEB;
|
||||
case '\u00CF': return 0xEC;
|
||||
case '\u00CC': return 0xED;
|
||||
case '\u00D3': return 0xEE;
|
||||
case '\u00D4': return 0xEF;
|
||||
case '\uF8FF': return 0xF0;
|
||||
case '\u00D2': return 0xF1;
|
||||
case '\u00DA': return 0xF2;
|
||||
case '\u00DB': return 0xF3;
|
||||
case '\u00D9': return 0xF4;
|
||||
case '\u0131': return 0xF5;
|
||||
case '\u02C6': return 0xF6;
|
||||
case '\u02DC': return 0xF7;
|
||||
case '\u00AF': return 0xF8;
|
||||
case '\u02D8': return 0xF9;
|
||||
case '\u02D9': return 0xFA;
|
||||
case '\u02DA': return 0xFB;
|
||||
case '\u00B8': return 0xFC;
|
||||
case '\u02DD': return 0xFD;
|
||||
case '\u02DB': return 0xFE;
|
||||
case '\u02C7': return 0xFF;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u0011' => 0x11,
|
||||
'\u2318' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u2713' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u25C6' => 0x13,
|
||||
'\u0014' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u007F' => 0x7F,
|
||||
'\u00C4' => 0x80,
|
||||
'\u00C5' => 0x81,
|
||||
'\u00C7' => 0x82,
|
||||
'\u00C9' => 0x83,
|
||||
'\u00D1' => 0x84,
|
||||
'\u00D6' => 0x85,
|
||||
'\u00DC' => 0x86,
|
||||
'\u00E1' => 0x87,
|
||||
'\u00E0' => 0x88,
|
||||
'\u00E2' => 0x89,
|
||||
'\u00E4' => 0x8A,
|
||||
'\u00E3' => 0x8B,
|
||||
'\u00E5' => 0x8C,
|
||||
'\u00E7' => 0x8D,
|
||||
'\u00E9' => 0x8E,
|
||||
'\u00E8' => 0x8F,
|
||||
'\u00EA' => 0x90,
|
||||
'\u00EB' => 0x91,
|
||||
'\u00ED' => 0x92,
|
||||
'\u00EC' => 0x93,
|
||||
'\u00EE' => 0x94,
|
||||
'\u00EF' => 0x95,
|
||||
'\u00F1' => 0x96,
|
||||
'\u00F3' => 0x97,
|
||||
'\u00F2' => 0x98,
|
||||
'\u00F4' => 0x99,
|
||||
'\u00F6' => 0x9A,
|
||||
'\u00F5' => 0x9B,
|
||||
'\u00FA' => 0x9C,
|
||||
'\u00F9' => 0x9D,
|
||||
'\u00FB' => 0x9E,
|
||||
'\u00FC' => 0x9F,
|
||||
'\u2020' => 0xA0,
|
||||
'\u00B0' => 0xA1,
|
||||
'\u00A2' => 0xA2,
|
||||
'\u00A3' => 0xA3,
|
||||
'\u00A7' => 0xA4,
|
||||
'\u2022' => 0xA5,
|
||||
'\u00B6' => 0xA6,
|
||||
'\u00DF' => 0xA7,
|
||||
'\u00AE' => 0xA8,
|
||||
'\u00A9' => 0xA9,
|
||||
'\u2122' => 0xAA,
|
||||
'\u00B4' => 0xAB,
|
||||
'\u00A8' => 0xAC,
|
||||
'\u2260' => 0xAD,
|
||||
'\u00C6' => 0xAE,
|
||||
'\u00D8' => 0xAF,
|
||||
'\u221E' => 0xB0,
|
||||
'\u00B1' => 0xB1,
|
||||
'\u2264' => 0xB2,
|
||||
'\u2265' => 0xB3,
|
||||
'\u00A5' => 0xB4,
|
||||
'\u00B5' => 0xB5,
|
||||
'\u2202' => 0xB6,
|
||||
'\u2211' => 0xB7,
|
||||
'\u220F' => 0xB8,
|
||||
'\u03C0' => 0xB9,
|
||||
'\u222B' => 0xBA,
|
||||
'\u00AA' => 0xBB,
|
||||
'\u00BA' => 0xBC,
|
||||
'\u03A9' => 0xBD,
|
||||
'\u00E6' => 0xBE,
|
||||
'\u00F8' => 0xBF,
|
||||
'\u00BF' => 0xC0,
|
||||
'\u00A1' => 0xC1,
|
||||
'\u00AC' => 0xC2,
|
||||
'\u221A' => 0xC3,
|
||||
'\u0192' => 0xC4,
|
||||
'\u2248' => 0xC5,
|
||||
'\u2206' => 0xC6,
|
||||
'\u00AB' => 0xC7,
|
||||
'\u00BB' => 0xC8,
|
||||
'\u2026' => 0xC9,
|
||||
'\u00A0' => 0xCA,
|
||||
'\u00C0' => 0xCB,
|
||||
'\u00C3' => 0xCC,
|
||||
'\u00D5' => 0xCD,
|
||||
'\u0152' => 0xCE,
|
||||
'\u0153' => 0xCF,
|
||||
'\u2013' => 0xD0,
|
||||
'\u2014' => 0xD1,
|
||||
'\u201C' => 0xD2,
|
||||
'\u201D' => 0xD3,
|
||||
'\u2018' => 0xD4,
|
||||
'\u2019' => 0xD5,
|
||||
'\u00F7' => 0xD6,
|
||||
'\u25CA' => 0xD7,
|
||||
'\u00FF' => 0xD8,
|
||||
'\u0178' => 0xD9,
|
||||
'\u2044' => 0xDA,
|
||||
'\u20AC' => 0xDB,
|
||||
'\u2039' => 0xDC,
|
||||
'\u203A' => 0xDD,
|
||||
'\uFB01' => 0xDE,
|
||||
'\uFB02' => 0xDF,
|
||||
'\u2021' => 0xE0,
|
||||
'\u00B7' => 0xE1,
|
||||
'\u201A' => 0xE2,
|
||||
'\u201E' => 0xE3,
|
||||
'\u2030' => 0xE4,
|
||||
'\u00C2' => 0xE5,
|
||||
'\u00CA' => 0xE6,
|
||||
'\u00C1' => 0xE7,
|
||||
'\u00CB' => 0xE8,
|
||||
'\u00C8' => 0xE9,
|
||||
'\u00CD' => 0xEA,
|
||||
'\u00CE' => 0xEB,
|
||||
'\u00CF' => 0xEC,
|
||||
'\u00CC' => 0xED,
|
||||
'\u00D3' => 0xEE,
|
||||
'\u00D4' => 0xEF,
|
||||
'\uF8FF' => 0xF0,
|
||||
'\u00D2' => 0xF1,
|
||||
'\u00DA' => 0xF2,
|
||||
'\u00DB' => 0xF3,
|
||||
'\u00D9' => 0xF4,
|
||||
'\u0131' => 0xF5,
|
||||
'\u02C6' => 0xF6,
|
||||
'\u02DC' => 0xF7,
|
||||
'\u00AF' => 0xF8,
|
||||
'\u02D8' => 0xF9,
|
||||
'\u02D9' => 0xFA,
|
||||
'\u02DA' => 0xFB,
|
||||
'\u00B8' => 0xFC,
|
||||
'\u02DD' => 0xFD,
|
||||
'\u02DB' => 0xFE,
|
||||
'\u02C7' => 0xFF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Apple Mac character encoding of Unicode characters.</summary>
|
||||
public class MacRomanian : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "x-mac-romanian";
|
||||
public override int CodePage => 10010;
|
||||
public override string EncodingName => "Romanianian (Mac)";
|
||||
public override string HeaderName => "x-mac-romanian";
|
||||
public override string WebName => "x-mac-romanian";
|
||||
public override int WindowsCodePage => 10010;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "x-mac-romanian";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 10010;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Romanianian (Mac)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "x-mac-romanian";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "x-mac-romanian";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 10010;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Mac to Unicode character map. MacRomanian is a superset of MacRomanian.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -53,7 +65,7 @@ namespace Claunia.Encoding
|
||||
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
|
||||
|
||||
// 0x10
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
|
||||
'\u0010', '\u2318', '\u2713', '\u25C6', '\uF8FF', '\u0015', '\u0016', '\u0017',
|
||||
|
||||
// 0x18
|
||||
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
|
||||
@@ -146,270 +158,267 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an MacRomanian character</summary>
|
||||
/// <returns>MacRomanian character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u00C4': return 0x80;
|
||||
case '\u00C5': return 0x81;
|
||||
case '\u00C7': return 0x82;
|
||||
case '\u00C9': return 0x83;
|
||||
case '\u00D1': return 0x84;
|
||||
case '\u00D6': return 0x85;
|
||||
case '\u00DC': return 0x86;
|
||||
case '\u00E1': return 0x87;
|
||||
case '\u00E0': return 0x88;
|
||||
case '\u00E2': return 0x89;
|
||||
case '\u00E4': return 0x8A;
|
||||
case '\u00E3': return 0x8B;
|
||||
case '\u00E5': return 0x8C;
|
||||
case '\u00E7': return 0x8D;
|
||||
case '\u00E9': return 0x8E;
|
||||
case '\u00E8': return 0x8F;
|
||||
case '\u00EA': return 0x90;
|
||||
case '\u00EB': return 0x91;
|
||||
case '\u00ED': return 0x92;
|
||||
case '\u00EC': return 0x93;
|
||||
case '\u00EE': return 0x94;
|
||||
case '\u00EF': return 0x95;
|
||||
case '\u00F1': return 0x96;
|
||||
case '\u00F3': return 0x97;
|
||||
case '\u00F2': return 0x98;
|
||||
case '\u00F4': return 0x99;
|
||||
case '\u00F6': return 0x9A;
|
||||
case '\u00F5': return 0x9B;
|
||||
case '\u00FA': return 0x9C;
|
||||
case '\u00F9': return 0x9D;
|
||||
case '\u00FB': return 0x9E;
|
||||
case '\u00FC': return 0x9F;
|
||||
case '\u2020': return 0xA0;
|
||||
case '\u00B0': return 0xA1;
|
||||
case '\u00A2': return 0xA2;
|
||||
case '\u00A3': return 0xA3;
|
||||
case '\u00A7': return 0xA4;
|
||||
case '\u2022': return 0xA5;
|
||||
case '\u00B6': return 0xA6;
|
||||
case '\u00DF': return 0xA7;
|
||||
case '\u00AE': return 0xA8;
|
||||
case '\u00A9': return 0xA9;
|
||||
case '\u2122': return 0xAA;
|
||||
case '\u00B4': return 0xAB;
|
||||
case '\u00A8': return 0xAC;
|
||||
case '\u2260': return 0xAD;
|
||||
case '\u0102': return 0xAE;
|
||||
case '\u0218': return 0xAF;
|
||||
case '\u221E': return 0xB0;
|
||||
case '\u00B1': return 0xB1;
|
||||
case '\u2264': return 0xB2;
|
||||
case '\u2265': return 0xB3;
|
||||
case '\u00A5': return 0xB4;
|
||||
case '\u00B5': return 0xB5;
|
||||
case '\u2202': return 0xB6;
|
||||
case '\u2211': return 0xB7;
|
||||
case '\u220F': return 0xB8;
|
||||
case '\u03C0': return 0xB9;
|
||||
case '\u222B': return 0xBA;
|
||||
case '\u00AA': return 0xBB;
|
||||
case '\u00BA': return 0xBC;
|
||||
case '\u03A9': return 0xBD;
|
||||
case '\u0103': return 0xBE;
|
||||
case '\u0219': return 0xBF;
|
||||
case '\u00BF': return 0xC0;
|
||||
case '\u00A1': return 0xC1;
|
||||
case '\u00AC': return 0xC2;
|
||||
case '\u221A': return 0xC3;
|
||||
case '\u0192': return 0xC4;
|
||||
case '\u2248': return 0xC5;
|
||||
case '\u2206': return 0xC6;
|
||||
case '\u00AB': return 0xC7;
|
||||
case '\u00BB': return 0xC8;
|
||||
case '\u2026': return 0xC9;
|
||||
case '\u00A0': return 0xCA;
|
||||
case '\u00C0': return 0xCB;
|
||||
case '\u00C3': return 0xCC;
|
||||
case '\u00D5': return 0xCD;
|
||||
case '\u0152': return 0xCE;
|
||||
case '\u0153': return 0xCF;
|
||||
case '\u2013': return 0xD0;
|
||||
case '\u2014': return 0xD1;
|
||||
case '\u201C': return 0xD2;
|
||||
case '\u201D': return 0xD3;
|
||||
case '\u2018': return 0xD4;
|
||||
case '\u2019': return 0xD5;
|
||||
case '\u00F7': return 0xD6;
|
||||
case '\u25CA': return 0xD7;
|
||||
case '\u00FF': return 0xD8;
|
||||
case '\u0178': return 0xD9;
|
||||
case '\u2044': return 0xDA;
|
||||
case '\u20AC': return 0xDB;
|
||||
case '\u2039': return 0xDC;
|
||||
case '\u203A': return 0xDD;
|
||||
case '\u021A': return 0xDE;
|
||||
case '\u021B': return 0xDF;
|
||||
case '\u2021': return 0xE0;
|
||||
case '\u00B7': return 0xE1;
|
||||
case '\u201A': return 0xE2;
|
||||
case '\u201E': return 0xE3;
|
||||
case '\u2030': return 0xE4;
|
||||
case '\u00C2': return 0xE5;
|
||||
case '\u00CA': return 0xE6;
|
||||
case '\u00C1': return 0xE7;
|
||||
case '\u00CB': return 0xE8;
|
||||
case '\u00C8': return 0xE9;
|
||||
case '\u00CD': return 0xEA;
|
||||
case '\u00CE': return 0xEB;
|
||||
case '\u00CF': return 0xEC;
|
||||
case '\u00CC': return 0xED;
|
||||
case '\u00D3': return 0xEE;
|
||||
case '\u00D4': return 0xEF;
|
||||
case '\uF8FF': return 0xF0;
|
||||
case '\u00D2': return 0xF1;
|
||||
case '\u00DA': return 0xF2;
|
||||
case '\u00DB': return 0xF3;
|
||||
case '\u00D9': return 0xF4;
|
||||
case '\u0131': return 0xF5;
|
||||
case '\u02C6': return 0xF6;
|
||||
case '\u02DC': return 0xF7;
|
||||
case '\u00AF': return 0xF8;
|
||||
case '\u02D8': return 0xF9;
|
||||
case '\u02D9': return 0xFA;
|
||||
case '\u02DA': return 0xFB;
|
||||
case '\u00B8': return 0xFC;
|
||||
case '\u02DD': return 0xFD;
|
||||
case '\u02DB': return 0xFE;
|
||||
case '\u02C7': return 0xFF;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u2318' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u2713' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u25C6' => 0x13,
|
||||
'\u0014' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u007F' => 0x7F,
|
||||
'\u00C4' => 0x80,
|
||||
'\u00C5' => 0x81,
|
||||
'\u00C7' => 0x82,
|
||||
'\u00C9' => 0x83,
|
||||
'\u00D1' => 0x84,
|
||||
'\u00D6' => 0x85,
|
||||
'\u00DC' => 0x86,
|
||||
'\u00E1' => 0x87,
|
||||
'\u00E0' => 0x88,
|
||||
'\u00E2' => 0x89,
|
||||
'\u00E4' => 0x8A,
|
||||
'\u00E3' => 0x8B,
|
||||
'\u00E5' => 0x8C,
|
||||
'\u00E7' => 0x8D,
|
||||
'\u00E9' => 0x8E,
|
||||
'\u00E8' => 0x8F,
|
||||
'\u00EA' => 0x90,
|
||||
'\u00EB' => 0x91,
|
||||
'\u00ED' => 0x92,
|
||||
'\u00EC' => 0x93,
|
||||
'\u00EE' => 0x94,
|
||||
'\u00EF' => 0x95,
|
||||
'\u00F1' => 0x96,
|
||||
'\u00F3' => 0x97,
|
||||
'\u00F2' => 0x98,
|
||||
'\u00F4' => 0x99,
|
||||
'\u00F6' => 0x9A,
|
||||
'\u00F5' => 0x9B,
|
||||
'\u00FA' => 0x9C,
|
||||
'\u00F9' => 0x9D,
|
||||
'\u00FB' => 0x9E,
|
||||
'\u00FC' => 0x9F,
|
||||
'\u2020' => 0xA0,
|
||||
'\u00B0' => 0xA1,
|
||||
'\u00A2' => 0xA2,
|
||||
'\u00A3' => 0xA3,
|
||||
'\u00A7' => 0xA4,
|
||||
'\u2022' => 0xA5,
|
||||
'\u00B6' => 0xA6,
|
||||
'\u00DF' => 0xA7,
|
||||
'\u00AE' => 0xA8,
|
||||
'\u00A9' => 0xA9,
|
||||
'\u2122' => 0xAA,
|
||||
'\u00B4' => 0xAB,
|
||||
'\u00A8' => 0xAC,
|
||||
'\u2260' => 0xAD,
|
||||
'\u0102' => 0xAE,
|
||||
'\u0218' => 0xAF,
|
||||
'\u221E' => 0xB0,
|
||||
'\u00B1' => 0xB1,
|
||||
'\u2264' => 0xB2,
|
||||
'\u2265' => 0xB3,
|
||||
'\u00A5' => 0xB4,
|
||||
'\u00B5' => 0xB5,
|
||||
'\u2202' => 0xB6,
|
||||
'\u2211' => 0xB7,
|
||||
'\u220F' => 0xB8,
|
||||
'\u03C0' => 0xB9,
|
||||
'\u222B' => 0xBA,
|
||||
'\u00AA' => 0xBB,
|
||||
'\u00BA' => 0xBC,
|
||||
'\u03A9' => 0xBD,
|
||||
'\u0103' => 0xBE,
|
||||
'\u0219' => 0xBF,
|
||||
'\u00BF' => 0xC0,
|
||||
'\u00A1' => 0xC1,
|
||||
'\u00AC' => 0xC2,
|
||||
'\u221A' => 0xC3,
|
||||
'\u0192' => 0xC4,
|
||||
'\u2248' => 0xC5,
|
||||
'\u2206' => 0xC6,
|
||||
'\u00AB' => 0xC7,
|
||||
'\u00BB' => 0xC8,
|
||||
'\u2026' => 0xC9,
|
||||
'\u00A0' => 0xCA,
|
||||
'\u00C0' => 0xCB,
|
||||
'\u00C3' => 0xCC,
|
||||
'\u00D5' => 0xCD,
|
||||
'\u0152' => 0xCE,
|
||||
'\u0153' => 0xCF,
|
||||
'\u2013' => 0xD0,
|
||||
'\u2014' => 0xD1,
|
||||
'\u201C' => 0xD2,
|
||||
'\u201D' => 0xD3,
|
||||
'\u2018' => 0xD4,
|
||||
'\u2019' => 0xD5,
|
||||
'\u00F7' => 0xD6,
|
||||
'\u25CA' => 0xD7,
|
||||
'\u00FF' => 0xD8,
|
||||
'\u0178' => 0xD9,
|
||||
'\u2044' => 0xDA,
|
||||
'\u20AC' => 0xDB,
|
||||
'\u2039' => 0xDC,
|
||||
'\u203A' => 0xDD,
|
||||
'\u021A' => 0xDE,
|
||||
'\u021B' => 0xDF,
|
||||
'\u2021' => 0xE0,
|
||||
'\u00B7' => 0xE1,
|
||||
'\u201A' => 0xE2,
|
||||
'\u201E' => 0xE3,
|
||||
'\u2030' => 0xE4,
|
||||
'\u00C2' => 0xE5,
|
||||
'\u00CA' => 0xE6,
|
||||
'\u00C1' => 0xE7,
|
||||
'\u00CB' => 0xE8,
|
||||
'\u00C8' => 0xE9,
|
||||
'\u00CD' => 0xEA,
|
||||
'\u00CE' => 0xEB,
|
||||
'\u00CF' => 0xEC,
|
||||
'\u00CC' => 0xED,
|
||||
'\u00D3' => 0xEE,
|
||||
'\u00D4' => 0xEF,
|
||||
'\uF8FF' => 0xF0,
|
||||
'\u00D2' => 0xF1,
|
||||
'\u00DA' => 0xF2,
|
||||
'\u00DB' => 0xF3,
|
||||
'\u00D9' => 0xF4,
|
||||
'\u0131' => 0xF5,
|
||||
'\u02C6' => 0xF6,
|
||||
'\u02DC' => 0xF7,
|
||||
'\u00AF' => 0xF8,
|
||||
'\u02D8' => 0xF9,
|
||||
'\u02D9' => 0xFA,
|
||||
'\u02DA' => 0xFB,
|
||||
'\u00B8' => 0xFC,
|
||||
'\u02DD' => 0xFD,
|
||||
'\u02DB' => 0xFE,
|
||||
'\u02C7' => 0xFF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Mac Turkish character encoding of Unicode characters.</summary>
|
||||
public class MacTurkish : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "x-mac-turkish";
|
||||
public override int CodePage => 10081;
|
||||
public override string EncodingName => "Turkish (Mac)";
|
||||
public override string HeaderName => "x-mac-turkish";
|
||||
public override string WebName => "x-mac-turkish";
|
||||
public override int WindowsCodePage => 10081;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "x-mac-turkish";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 10081;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Turkish (Mac)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "x-mac-turkish";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "x-mac-turkish";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 10081;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Macintosh Turkish to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -53,7 +65,7 @@ namespace Claunia.Encoding
|
||||
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
|
||||
|
||||
// 0x10
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
|
||||
'\u0010', '\u2318', '\u2713', '\u25C6', '\uF8FF', '\u0015', '\u0016', '\u0017',
|
||||
|
||||
// 0x18
|
||||
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
|
||||
@@ -146,270 +158,267 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an Mac Turkish character</summary>
|
||||
/// <returns>Mac Turkish character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u00C4': return 0x80;
|
||||
case '\u00C5': return 0x81;
|
||||
case '\u00C7': return 0x82;
|
||||
case '\u00C9': return 0x83;
|
||||
case '\u00D1': return 0x84;
|
||||
case '\u00D6': return 0x85;
|
||||
case '\u00DC': return 0x86;
|
||||
case '\u00E1': return 0x87;
|
||||
case '\u00E0': return 0x88;
|
||||
case '\u00E2': return 0x89;
|
||||
case '\u00E4': return 0x8A;
|
||||
case '\u00E3': return 0x8B;
|
||||
case '\u00E5': return 0x8C;
|
||||
case '\u00E7': return 0x8D;
|
||||
case '\u00E9': return 0x8E;
|
||||
case '\u00E8': return 0x8F;
|
||||
case '\u00EA': return 0x90;
|
||||
case '\u00EB': return 0x91;
|
||||
case '\u00ED': return 0x92;
|
||||
case '\u00EC': return 0x93;
|
||||
case '\u00EE': return 0x94;
|
||||
case '\u00EF': return 0x95;
|
||||
case '\u00F1': return 0x96;
|
||||
case '\u00F3': return 0x97;
|
||||
case '\u00F2': return 0x98;
|
||||
case '\u00F4': return 0x99;
|
||||
case '\u00F6': return 0x9A;
|
||||
case '\u00F5': return 0x9B;
|
||||
case '\u00FA': return 0x9C;
|
||||
case '\u00F9': return 0x9D;
|
||||
case '\u00FB': return 0x9E;
|
||||
case '\u00FC': return 0x9F;
|
||||
case '\u2020': return 0xA0;
|
||||
case '\u00B0': return 0xA1;
|
||||
case '\u00A2': return 0xA2;
|
||||
case '\u00A3': return 0xA3;
|
||||
case '\u00A7': return 0xA4;
|
||||
case '\u2022': return 0xA5;
|
||||
case '\u00B6': return 0xA6;
|
||||
case '\u00DF': return 0xA7;
|
||||
case '\u00AE': return 0xA8;
|
||||
case '\u00A9': return 0xA9;
|
||||
case '\u2122': return 0xAA;
|
||||
case '\u00B4': return 0xAB;
|
||||
case '\u00A8': return 0xAC;
|
||||
case '\u2260': return 0xAD;
|
||||
case '\u00C6': return 0xAE;
|
||||
case '\u00D8': return 0xAF;
|
||||
case '\u221E': return 0xB0;
|
||||
case '\u00B1': return 0xB1;
|
||||
case '\u2264': return 0xB2;
|
||||
case '\u2265': return 0xB3;
|
||||
case '\u00A5': return 0xB4;
|
||||
case '\u00B5': return 0xB5;
|
||||
case '\u2202': return 0xB6;
|
||||
case '\u2211': return 0xB7;
|
||||
case '\u220F': return 0xB8;
|
||||
case '\u03C0': return 0xB9;
|
||||
case '\u222B': return 0xBA;
|
||||
case '\u00AA': return 0xBB;
|
||||
case '\u00BA': return 0xBC;
|
||||
case '\u03A9': return 0xBD;
|
||||
case '\u00E6': return 0xBE;
|
||||
case '\u00F8': return 0xBF;
|
||||
case '\u00BF': return 0xC0;
|
||||
case '\u00A1': return 0xC1;
|
||||
case '\u00AC': return 0xC2;
|
||||
case '\u221A': return 0xC3;
|
||||
case '\u0192': return 0xC4;
|
||||
case '\u2248': return 0xC5;
|
||||
case '\u2206': return 0xC6;
|
||||
case '\u00AB': return 0xC7;
|
||||
case '\u00BB': return 0xC8;
|
||||
case '\u2026': return 0xC9;
|
||||
case '\u00A0': return 0xCA;
|
||||
case '\u00C0': return 0xCB;
|
||||
case '\u00C3': return 0xCC;
|
||||
case '\u00D5': return 0xCD;
|
||||
case '\u0152': return 0xCE;
|
||||
case '\u0153': return 0xCF;
|
||||
case '\u2013': return 0xD0;
|
||||
case '\u2014': return 0xD1;
|
||||
case '\u201C': return 0xD2;
|
||||
case '\u201D': return 0xD3;
|
||||
case '\u2018': return 0xD4;
|
||||
case '\u2019': return 0xD5;
|
||||
case '\u00F7': return 0xD6;
|
||||
case '\u05CA': return 0xD7;
|
||||
case '\u00FF': return 0xD8;
|
||||
case '\u0178': return 0xD9;
|
||||
case '\u011E': return 0xDA;
|
||||
case '\u011F': return 0xDB;
|
||||
case '\u0130': return 0xDC;
|
||||
case '\u0131': return 0xDD;
|
||||
case '\u015E': return 0xDE;
|
||||
case '\u015F': return 0xDF;
|
||||
case '\u2021': return 0xE0;
|
||||
case '\u00B7': return 0xE1;
|
||||
case '\u201A': return 0xE2;
|
||||
case '\u201E': return 0xE3;
|
||||
case '\u2030': return 0xE4;
|
||||
case '\u00C2': return 0xE5;
|
||||
case '\u00CA': return 0xE6;
|
||||
case '\u00C1': return 0xE7;
|
||||
case '\u00CB': return 0xE8;
|
||||
case '\u00C8': return 0xE9;
|
||||
case '\u00CD': return 0xEA;
|
||||
case '\u00CE': return 0xEB;
|
||||
case '\u00CF': return 0xEC;
|
||||
case '\u00CC': return 0xED;
|
||||
case '\u00D3': return 0xEE;
|
||||
case '\u00D4': return 0xEF;
|
||||
case '\uF8FF': return 0xF0;
|
||||
case '\u00D2': return 0xF1;
|
||||
case '\u00DA': return 0xF2;
|
||||
case '\u00DB': return 0xF3;
|
||||
case '\u00D9': return 0xF4;
|
||||
case '\uF8A0': return 0xF5;
|
||||
case '\u02C6': return 0xF6;
|
||||
case '\u02DC': return 0xF7;
|
||||
case '\u00AF': return 0xF8;
|
||||
case '\u02D8': return 0xF9;
|
||||
case '\u02D9': return 0xFA;
|
||||
case '\u02DA': return 0xFB;
|
||||
case '\u00B8': return 0xFC;
|
||||
case '\u02DD': return 0xFD;
|
||||
case '\u02DB': return 0xFE;
|
||||
case '\u02C7': return 0xFF;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u2318' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u2713' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u25C6' => 0x13,
|
||||
'\u0014' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u007F' => 0x7F,
|
||||
'\u00C4' => 0x80,
|
||||
'\u00C5' => 0x81,
|
||||
'\u00C7' => 0x82,
|
||||
'\u00C9' => 0x83,
|
||||
'\u00D1' => 0x84,
|
||||
'\u00D6' => 0x85,
|
||||
'\u00DC' => 0x86,
|
||||
'\u00E1' => 0x87,
|
||||
'\u00E0' => 0x88,
|
||||
'\u00E2' => 0x89,
|
||||
'\u00E4' => 0x8A,
|
||||
'\u00E3' => 0x8B,
|
||||
'\u00E5' => 0x8C,
|
||||
'\u00E7' => 0x8D,
|
||||
'\u00E9' => 0x8E,
|
||||
'\u00E8' => 0x8F,
|
||||
'\u00EA' => 0x90,
|
||||
'\u00EB' => 0x91,
|
||||
'\u00ED' => 0x92,
|
||||
'\u00EC' => 0x93,
|
||||
'\u00EE' => 0x94,
|
||||
'\u00EF' => 0x95,
|
||||
'\u00F1' => 0x96,
|
||||
'\u00F3' => 0x97,
|
||||
'\u00F2' => 0x98,
|
||||
'\u00F4' => 0x99,
|
||||
'\u00F6' => 0x9A,
|
||||
'\u00F5' => 0x9B,
|
||||
'\u00FA' => 0x9C,
|
||||
'\u00F9' => 0x9D,
|
||||
'\u00FB' => 0x9E,
|
||||
'\u00FC' => 0x9F,
|
||||
'\u2020' => 0xA0,
|
||||
'\u00B0' => 0xA1,
|
||||
'\u00A2' => 0xA2,
|
||||
'\u00A3' => 0xA3,
|
||||
'\u00A7' => 0xA4,
|
||||
'\u2022' => 0xA5,
|
||||
'\u00B6' => 0xA6,
|
||||
'\u00DF' => 0xA7,
|
||||
'\u00AE' => 0xA8,
|
||||
'\u00A9' => 0xA9,
|
||||
'\u2122' => 0xAA,
|
||||
'\u00B4' => 0xAB,
|
||||
'\u00A8' => 0xAC,
|
||||
'\u2260' => 0xAD,
|
||||
'\u00C6' => 0xAE,
|
||||
'\u00D8' => 0xAF,
|
||||
'\u221E' => 0xB0,
|
||||
'\u00B1' => 0xB1,
|
||||
'\u2264' => 0xB2,
|
||||
'\u2265' => 0xB3,
|
||||
'\u00A5' => 0xB4,
|
||||
'\u00B5' => 0xB5,
|
||||
'\u2202' => 0xB6,
|
||||
'\u2211' => 0xB7,
|
||||
'\u220F' => 0xB8,
|
||||
'\u03C0' => 0xB9,
|
||||
'\u222B' => 0xBA,
|
||||
'\u00AA' => 0xBB,
|
||||
'\u00BA' => 0xBC,
|
||||
'\u03A9' => 0xBD,
|
||||
'\u00E6' => 0xBE,
|
||||
'\u00F8' => 0xBF,
|
||||
'\u00BF' => 0xC0,
|
||||
'\u00A1' => 0xC1,
|
||||
'\u00AC' => 0xC2,
|
||||
'\u221A' => 0xC3,
|
||||
'\u0192' => 0xC4,
|
||||
'\u2248' => 0xC5,
|
||||
'\u2206' => 0xC6,
|
||||
'\u00AB' => 0xC7,
|
||||
'\u00BB' => 0xC8,
|
||||
'\u2026' => 0xC9,
|
||||
'\u00A0' => 0xCA,
|
||||
'\u00C0' => 0xCB,
|
||||
'\u00C3' => 0xCC,
|
||||
'\u00D5' => 0xCD,
|
||||
'\u0152' => 0xCE,
|
||||
'\u0153' => 0xCF,
|
||||
'\u2013' => 0xD0,
|
||||
'\u2014' => 0xD1,
|
||||
'\u201C' => 0xD2,
|
||||
'\u201D' => 0xD3,
|
||||
'\u2018' => 0xD4,
|
||||
'\u2019' => 0xD5,
|
||||
'\u00F7' => 0xD6,
|
||||
'\u05CA' => 0xD7,
|
||||
'\u00FF' => 0xD8,
|
||||
'\u0178' => 0xD9,
|
||||
'\u011E' => 0xDA,
|
||||
'\u011F' => 0xDB,
|
||||
'\u0130' => 0xDC,
|
||||
'\u0131' => 0xDD,
|
||||
'\u015E' => 0xDE,
|
||||
'\u015F' => 0xDF,
|
||||
'\u2021' => 0xE0,
|
||||
'\u00B7' => 0xE1,
|
||||
'\u201A' => 0xE2,
|
||||
'\u201E' => 0xE3,
|
||||
'\u2030' => 0xE4,
|
||||
'\u00C2' => 0xE5,
|
||||
'\u00CA' => 0xE6,
|
||||
'\u00C1' => 0xE7,
|
||||
'\u00CB' => 0xE8,
|
||||
'\u00C8' => 0xE9,
|
||||
'\u00CD' => 0xEA,
|
||||
'\u00CE' => 0xEB,
|
||||
'\u00CF' => 0xEC,
|
||||
'\u00CC' => 0xED,
|
||||
'\u00D3' => 0xEE,
|
||||
'\u00D4' => 0xEF,
|
||||
'\uF8FF' => 0xF0,
|
||||
'\u00D2' => 0xF1,
|
||||
'\u00DA' => 0xF2,
|
||||
'\u00DB' => 0xF3,
|
||||
'\u00D9' => 0xF4,
|
||||
'\uF8A0' => 0xF5,
|
||||
'\u02C6' => 0xF6,
|
||||
'\u02DC' => 0xF7,
|
||||
'\u00AF' => 0xF8,
|
||||
'\u02D8' => 0xF9,
|
||||
'\u02D9' => 0xFA,
|
||||
'\u02DA' => 0xFB,
|
||||
'\u00B8' => 0xFC,
|
||||
'\u02DD' => 0xFD,
|
||||
'\u02DB' => 0xFE,
|
||||
'\u02C7' => 0xFF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Mac Ukrainian character encoding of Unicode characters.</summary>
|
||||
public class MacUkrainian : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "x-mac-ukrainian";
|
||||
public override int CodePage => 10017;
|
||||
public override string EncodingName => "Ukrainian (Mac)";
|
||||
public override string HeaderName => "x-mac-ukrainian";
|
||||
public override string WebName => "x-mac-ukrainian";
|
||||
public override int WindowsCodePage => 10017;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "x-mac-ukrainian";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 10017;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Ukrainian (Mac)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "x-mac-ukrainian";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "x-mac-ukrainian";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 10017;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => true;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The Macintosh Ukrainian to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -53,7 +65,7 @@ namespace Claunia.Encoding
|
||||
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
|
||||
|
||||
// 0x10
|
||||
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
|
||||
'\u0010', '\u2318', '\u2713', '\u25C6', '\uF8FF', '\u0015', '\u0016', '\u0017',
|
||||
|
||||
// 0x18
|
||||
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
|
||||
@@ -146,270 +158,268 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an Mac Ukrainian character</summary>
|
||||
/// <returns>Mac Ukrainian character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0000': return 0x00;
|
||||
case '\u0001': return 0x01;
|
||||
case '\u0002': return 0x02;
|
||||
case '\u0003': return 0x03;
|
||||
case '\u0004': return 0x04;
|
||||
case '\u0005': return 0x05;
|
||||
case '\u0006': return 0x06;
|
||||
case '\u0007': return 0x07;
|
||||
case '\u0008': return 0x08;
|
||||
case '\u0009': return 0x09;
|
||||
case '\u000A': return 0x0A;
|
||||
case '\u000B': return 0x0B;
|
||||
case '\u000C': return 0x0C;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u000E': return 0x0E;
|
||||
case '\u000F': return 0x0F;
|
||||
case '\u0010': return 0x10;
|
||||
case '\u0011': return 0x11;
|
||||
case '\u0012': return 0x12;
|
||||
case '\u0013': return 0x13;
|
||||
case '\u0014': return 0x14;
|
||||
case '\u0015': return 0x15;
|
||||
case '\u0016': return 0x16;
|
||||
case '\u0017': return 0x17;
|
||||
case '\u0018': return 0x18;
|
||||
case '\u0019': return 0x19;
|
||||
case '\u001A': return 0x1A;
|
||||
case '\u001B': return 0x1B;
|
||||
case '\u001C': return 0x1C;
|
||||
case '\u001D': return 0x1D;
|
||||
case '\u001E': return 0x1E;
|
||||
case '\u001F': return 0x1F;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u005E': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u0060': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u007F': return 0x7F;
|
||||
case '\u0410': return 0x80;
|
||||
case '\u0411': return 0x81;
|
||||
case '\u0412': return 0x82;
|
||||
case '\u0413': return 0x83;
|
||||
case '\u0414': return 0x84;
|
||||
case '\u0415': return 0x85;
|
||||
case '\u0416': return 0x86;
|
||||
case '\u0417': return 0x87;
|
||||
case '\u0418': return 0x88;
|
||||
case '\u0419': return 0x89;
|
||||
case '\u041A': return 0x8A;
|
||||
case '\u041B': return 0x8B;
|
||||
case '\u041C': return 0x8C;
|
||||
case '\u041D': return 0x8D;
|
||||
case '\u041E': return 0x8E;
|
||||
case '\u041F': return 0x8F;
|
||||
case '\u0420': return 0x90;
|
||||
case '\u0421': return 0x91;
|
||||
case '\u0422': return 0x92;
|
||||
case '\u0423': return 0x93;
|
||||
case '\u0424': return 0x94;
|
||||
case '\u0425': return 0x95;
|
||||
case '\u0426': return 0x96;
|
||||
case '\u0427': return 0x97;
|
||||
case '\u0428': return 0x98;
|
||||
case '\u0429': return 0x99;
|
||||
case '\u042A': return 0x9A;
|
||||
case '\u042B': return 0x9B;
|
||||
case '\u042C': return 0x9C;
|
||||
case '\u042D': return 0x9D;
|
||||
case '\u042E': return 0x9E;
|
||||
case '\u042F': return 0x9F;
|
||||
case '\u2020': return 0xA0;
|
||||
case '\u00B0': return 0xA1;
|
||||
case '\u0490': return 0xA2;
|
||||
case '\u00A3': return 0xA3;
|
||||
case '\u00A7': return 0xA4;
|
||||
case '\u2022': return 0xA5;
|
||||
case '\u00B6': return 0xA6;
|
||||
case '\u0406': return 0xA7;
|
||||
case '\u00AE': return 0xA8;
|
||||
case '\u00A9': return 0xA9;
|
||||
case '\u2122': return 0xAA;
|
||||
case '\u0402': return 0xAB;
|
||||
case '\u0452': return 0xAC;
|
||||
case '\u2260': return 0xAD;
|
||||
case '\u0403': return 0xAE;
|
||||
case '\u0453': return 0xAF;
|
||||
case '\u221E': return 0xB0;
|
||||
case '\u00B1': return 0xB1;
|
||||
case '\u2264': return 0xB2;
|
||||
case '\u2265': return 0xB3;
|
||||
case '\u0456': return 0xB4;
|
||||
case '\u00B5': return 0xB5;
|
||||
case '\u0491': return 0xB6;
|
||||
case '\u0408': return 0xB7;
|
||||
case '\u0404': return 0xB8;
|
||||
case '\u0454': return 0xB9;
|
||||
case '\u0407': return 0xBA;
|
||||
case '\u0457': return 0xBB;
|
||||
case '\u0409': return 0xBC;
|
||||
case '\u0459': return 0xBD;
|
||||
case '\u040A': return 0xBE;
|
||||
case '\u045A': return 0xBF;
|
||||
case '\u0458': return 0xC0;
|
||||
case '\u0405': return 0xC1;
|
||||
case '\u00AC': return 0xC2;
|
||||
case '\u221A': return 0xC3;
|
||||
case '\u0192': return 0xC4;
|
||||
case '\u2248': return 0xC5;
|
||||
case '\u2206': return 0xC6;
|
||||
case '\u00AB': return 0xC7;
|
||||
case '\u00BB': return 0xC8;
|
||||
case '\u2026': return 0xC9;
|
||||
case '\u00A0': return 0xCA;
|
||||
case '\u040B': return 0xCB;
|
||||
case '\u045B': return 0xCC;
|
||||
case '\u040C': return 0xCD;
|
||||
case '\u045C': return 0xCE;
|
||||
case '\u0455': return 0xCF;
|
||||
case '\u2013': return 0xD0;
|
||||
case '\u2014': return 0xD1;
|
||||
case '\u201C': return 0xD2;
|
||||
case '\u201D': return 0xD3;
|
||||
case '\u2018': return 0xD4;
|
||||
case '\u2019': return 0xD5;
|
||||
case '\u00F7': return 0xD6;
|
||||
case '\u201E': return 0xD7;
|
||||
case '\u040E': return 0xD8;
|
||||
case '\u045E': return 0xD9;
|
||||
case '\u040F': return 0xDA;
|
||||
case '\u045F': return 0xDB;
|
||||
case '\u2116': return 0xDC;
|
||||
case '\u0401': return 0xDD;
|
||||
case '\u0451': return 0xDE;
|
||||
case '\u044F': return 0xDF;
|
||||
case '\u0430': return 0xE0;
|
||||
case '\u0431': return 0xE1;
|
||||
case '\u0432': return 0xE2;
|
||||
case '\u0433': return 0xE3;
|
||||
case '\u0434': return 0xE4;
|
||||
case '\u0435': return 0xE5;
|
||||
case '\u0436': return 0xE6;
|
||||
case '\u0437': return 0xE7;
|
||||
case '\u0438': return 0xE8;
|
||||
case '\u0439': return 0xE9;
|
||||
case '\u043A': return 0xEA;
|
||||
case '\u043B': return 0xEB;
|
||||
case '\u043C': return 0xEC;
|
||||
case '\u043D': return 0xED;
|
||||
case '\u043E': return 0xEE;
|
||||
case '\u043F': return 0xEF;
|
||||
case '\u0440': return 0xF0;
|
||||
case '\u0441': return 0xF1;
|
||||
case '\u0442': return 0xF2;
|
||||
case '\u0443': return 0xF3;
|
||||
case '\u0444': return 0xF4;
|
||||
case '\u0445': return 0xF5;
|
||||
case '\u0446': return 0xF6;
|
||||
case '\u0447': return 0xF7;
|
||||
case '\u0448': return 0xF8;
|
||||
case '\u0449': return 0xF9;
|
||||
case '\u044A': return 0xFA;
|
||||
case '\u044B': return 0xFB;
|
||||
case '\u044C': return 0xFC;
|
||||
case '\u044D': return 0xFD;
|
||||
case '\u044E': return 0xFE;
|
||||
case '\u20AC': return 0xFF;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0000' => 0x00,
|
||||
'\u0001' => 0x01,
|
||||
'\u0002' => 0x02,
|
||||
'\u0003' => 0x03,
|
||||
'\u0004' => 0x04,
|
||||
'\u0005' => 0x05,
|
||||
'\u0006' => 0x06,
|
||||
'\u0007' => 0x07,
|
||||
'\u0008' => 0x08,
|
||||
'\u0009' => 0x09,
|
||||
'\u000A' => 0x0A,
|
||||
'\u000B' => 0x0B,
|
||||
'\u000C' => 0x0C,
|
||||
'\u000D' => 0x0D,
|
||||
'\u000E' => 0x0E,
|
||||
'\u000F' => 0x0F,
|
||||
'\u0010' => 0x10,
|
||||
'\u2318' => 0x11,
|
||||
'\u0012' => 0x12,
|
||||
'\u2713' => 0x12,
|
||||
'\u0013' => 0x13,
|
||||
'\u25C6' => 0x13,
|
||||
'\uF8FF' => 0x13,
|
||||
'\u0014' => 0x14,
|
||||
'\u0015' => 0x15,
|
||||
'\u0016' => 0x16,
|
||||
'\u0017' => 0x17,
|
||||
'\u0018' => 0x18,
|
||||
'\u0019' => 0x19,
|
||||
'\u001A' => 0x1A,
|
||||
'\u001B' => 0x1B,
|
||||
'\u001C' => 0x1C,
|
||||
'\u001D' => 0x1D,
|
||||
'\u001E' => 0x1E,
|
||||
'\u001F' => 0x1F,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u005E' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u0060' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u007F' => 0x7F,
|
||||
'\u0410' => 0x80,
|
||||
'\u0411' => 0x81,
|
||||
'\u0412' => 0x82,
|
||||
'\u0413' => 0x83,
|
||||
'\u0414' => 0x84,
|
||||
'\u0415' => 0x85,
|
||||
'\u0416' => 0x86,
|
||||
'\u0417' => 0x87,
|
||||
'\u0418' => 0x88,
|
||||
'\u0419' => 0x89,
|
||||
'\u041A' => 0x8A,
|
||||
'\u041B' => 0x8B,
|
||||
'\u041C' => 0x8C,
|
||||
'\u041D' => 0x8D,
|
||||
'\u041E' => 0x8E,
|
||||
'\u041F' => 0x8F,
|
||||
'\u0420' => 0x90,
|
||||
'\u0421' => 0x91,
|
||||
'\u0422' => 0x92,
|
||||
'\u0423' => 0x93,
|
||||
'\u0424' => 0x94,
|
||||
'\u0425' => 0x95,
|
||||
'\u0426' => 0x96,
|
||||
'\u0427' => 0x97,
|
||||
'\u0428' => 0x98,
|
||||
'\u0429' => 0x99,
|
||||
'\u042A' => 0x9A,
|
||||
'\u042B' => 0x9B,
|
||||
'\u042C' => 0x9C,
|
||||
'\u042D' => 0x9D,
|
||||
'\u042E' => 0x9E,
|
||||
'\u042F' => 0x9F,
|
||||
'\u2020' => 0xA0,
|
||||
'\u00B0' => 0xA1,
|
||||
'\u0490' => 0xA2,
|
||||
'\u00A3' => 0xA3,
|
||||
'\u00A7' => 0xA4,
|
||||
'\u2022' => 0xA5,
|
||||
'\u00B6' => 0xA6,
|
||||
'\u0406' => 0xA7,
|
||||
'\u00AE' => 0xA8,
|
||||
'\u00A9' => 0xA9,
|
||||
'\u2122' => 0xAA,
|
||||
'\u0402' => 0xAB,
|
||||
'\u0452' => 0xAC,
|
||||
'\u2260' => 0xAD,
|
||||
'\u0403' => 0xAE,
|
||||
'\u0453' => 0xAF,
|
||||
'\u221E' => 0xB0,
|
||||
'\u00B1' => 0xB1,
|
||||
'\u2264' => 0xB2,
|
||||
'\u2265' => 0xB3,
|
||||
'\u0456' => 0xB4,
|
||||
'\u00B5' => 0xB5,
|
||||
'\u0491' => 0xB6,
|
||||
'\u0408' => 0xB7,
|
||||
'\u0404' => 0xB8,
|
||||
'\u0454' => 0xB9,
|
||||
'\u0407' => 0xBA,
|
||||
'\u0457' => 0xBB,
|
||||
'\u0409' => 0xBC,
|
||||
'\u0459' => 0xBD,
|
||||
'\u040A' => 0xBE,
|
||||
'\u045A' => 0xBF,
|
||||
'\u0458' => 0xC0,
|
||||
'\u0405' => 0xC1,
|
||||
'\u00AC' => 0xC2,
|
||||
'\u221A' => 0xC3,
|
||||
'\u0192' => 0xC4,
|
||||
'\u2248' => 0xC5,
|
||||
'\u2206' => 0xC6,
|
||||
'\u00AB' => 0xC7,
|
||||
'\u00BB' => 0xC8,
|
||||
'\u2026' => 0xC9,
|
||||
'\u00A0' => 0xCA,
|
||||
'\u040B' => 0xCB,
|
||||
'\u045B' => 0xCC,
|
||||
'\u040C' => 0xCD,
|
||||
'\u045C' => 0xCE,
|
||||
'\u0455' => 0xCF,
|
||||
'\u2013' => 0xD0,
|
||||
'\u2014' => 0xD1,
|
||||
'\u201C' => 0xD2,
|
||||
'\u201D' => 0xD3,
|
||||
'\u2018' => 0xD4,
|
||||
'\u2019' => 0xD5,
|
||||
'\u00F7' => 0xD6,
|
||||
'\u201E' => 0xD7,
|
||||
'\u040E' => 0xD8,
|
||||
'\u045E' => 0xD9,
|
||||
'\u040F' => 0xDA,
|
||||
'\u045F' => 0xDB,
|
||||
'\u2116' => 0xDC,
|
||||
'\u0401' => 0xDD,
|
||||
'\u0451' => 0xDE,
|
||||
'\u044F' => 0xDF,
|
||||
'\u0430' => 0xE0,
|
||||
'\u0431' => 0xE1,
|
||||
'\u0432' => 0xE2,
|
||||
'\u0433' => 0xE3,
|
||||
'\u0434' => 0xE4,
|
||||
'\u0435' => 0xE5,
|
||||
'\u0436' => 0xE6,
|
||||
'\u0437' => 0xE7,
|
||||
'\u0438' => 0xE8,
|
||||
'\u0439' => 0xE9,
|
||||
'\u043A' => 0xEA,
|
||||
'\u043B' => 0xEB,
|
||||
'\u043C' => 0xEC,
|
||||
'\u043D' => 0xED,
|
||||
'\u043E' => 0xEE,
|
||||
'\u043F' => 0xEF,
|
||||
'\u0440' => 0xF0,
|
||||
'\u0441' => 0xF1,
|
||||
'\u0442' => 0xF2,
|
||||
'\u0443' => 0xF3,
|
||||
'\u0444' => 0xF4,
|
||||
'\u0445' => 0xF5,
|
||||
'\u0446' => 0xF6,
|
||||
'\u0447' => 0xF7,
|
||||
'\u0448' => 0xF8,
|
||||
'\u0449' => 0xF9,
|
||||
'\u044A' => 0xFA,
|
||||
'\u044B' => 0xFB,
|
||||
'\u044C' => 0xFC,
|
||||
'\u044D' => 0xFD,
|
||||
'\u044E' => 0xFE,
|
||||
'\u20AC' => 0xFF,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -24,135 +24,181 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System.Text;
|
||||
|
||||
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 : SingleByteEncoding
|
||||
public class Petscii : SingleByteEncodingWithRunes
|
||||
{
|
||||
public override string BodyName => "petscii";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Commodore PET Standard Code for Information Interchange";
|
||||
public override string HeaderName => "petscii";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "petscii";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Commodore PET Standard Code for Information Interchange";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "petscii";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => false;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The PETSCII to Unicode character map, unshifted (default) variant.</summary>
|
||||
/// <remarks>Reference used: http://style64.org/petscii/ and others.</remarks>
|
||||
protected override char[] CharTable => new[]
|
||||
protected override Rune[] CharTable => new[]
|
||||
{
|
||||
// 0x00
|
||||
'\u0000', '\u0000', '\u0000', '\u0003', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0003), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x08
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u000A', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x000A),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x10
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0008', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0008), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x18
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x20
|
||||
'\u0020', '\u0021', '\u0022', '\u0023', '\u0024', '\u0025', '\u0026', '\u0027',
|
||||
new Rune(0x0020), new Rune(0x0021), new Rune(0x0022), new Rune(0x0023), new Rune(0x0024), new Rune(0x0025),
|
||||
new Rune(0x0026), new Rune(0x0027),
|
||||
|
||||
// 0x28
|
||||
'\u0028', '\u0029', '\u002A', '\u002B', '\u002C', '\u002D', '\u002E', '\u002F',
|
||||
new Rune(0x0028), new Rune(0x0029), new Rune(0x002A), new Rune(0x002B), new Rune(0x002C), new Rune(0x002D),
|
||||
new Rune(0x002E), new Rune(0x002F),
|
||||
|
||||
// 0x30
|
||||
'\u0030', '\u0031', '\u0032', '\u0033', '\u0034', '\u0035', '\u0036', '\u0037',
|
||||
new Rune(0x0030), new Rune(0x0031), new Rune(0x0032), new Rune(0x0033), new Rune(0x0034), new Rune(0x0035),
|
||||
new Rune(0x0036), new Rune(0x0037),
|
||||
|
||||
// 0x38
|
||||
'\u0038', '\u0039', '\u003A', '\u003B', '\u003C', '\u003D', '\u003E', '\u003F',
|
||||
new Rune(0x0038), new Rune(0x0039), new Rune(0x003A), new Rune(0x003B), new Rune(0x003C), new Rune(0x003D),
|
||||
new Rune(0x003E), new Rune(0x003F),
|
||||
|
||||
// 0x40
|
||||
'\u0040', '\u0041', '\u0042', '\u0043', '\u0044', '\u0045', '\u0046', '\u0047',
|
||||
new Rune(0x0040), new Rune(0x0041), new Rune(0x0042), new Rune(0x0043), new Rune(0x0044), new Rune(0x0045),
|
||||
new Rune(0x0046), new Rune(0x0047),
|
||||
|
||||
// 0x48
|
||||
'\u0048', '\u0049', '\u004A', '\u004B', '\u004C', '\u004D', '\u004E', '\u004F',
|
||||
new Rune(0x0048), new Rune(0x0049), new Rune(0x004A), new Rune(0x004B), new Rune(0x004C), new Rune(0x004D),
|
||||
new Rune(0x004E), new Rune(0x004F),
|
||||
|
||||
// 0x50
|
||||
'\u0050', '\u0051', '\u0052', '\u0053', '\u0054', '\u0055', '\u0056', '\u0057',
|
||||
new Rune(0x0050), new Rune(0x0051), new Rune(0x0052), new Rune(0x0053), new Rune(0x0054), new Rune(0x0055),
|
||||
new Rune(0x0056), new Rune(0x0057),
|
||||
|
||||
// 0x58
|
||||
'\u0058', '\u0059', '\u005A', '\u005B', '\u00A3', '\u005D', '\u2191', '\u2190',
|
||||
new Rune(0x0058), new Rune(0x0059), new Rune(0x005A), new Rune(0x005B), new Rune(0x00A3), new Rune(0x005D),
|
||||
new Rune(0x2191), new Rune(0x2190),
|
||||
|
||||
// 0x60
|
||||
'\u2500', '\u2660', '\u2502', '\u2500', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x1FB79), new Rune(0x2660), new Rune(0x1FB72), new Rune(0x1FB78), new Rune(0x1FB77),
|
||||
new Rune(0x1FB76), new Rune(0x1FB7A), new Rune(0x1FB71),
|
||||
|
||||
// 0x68
|
||||
'\u0000', '\u256E', '\u2570', '\u256F', '\u0000', '\u2572', '\u2571', '\u0000',
|
||||
new Rune(0x1FB74), new Rune(0x256E), new Rune(0x2570), new Rune(0x256F), new Rune(0x1FB7C),
|
||||
new Rune(0x2572), new Rune(0x2571), new Rune(0x1FB7D),
|
||||
|
||||
// 0x70
|
||||
'\u0000', '\u2022', '\u0000', '\u2665', '\u0000', '\u256D', '\u2573', '\u25CB',
|
||||
new Rune(0x1FB7E), new Rune(0x25CF), new Rune(0x1FB7B), new Rune(0x2665), new Rune(0x1FB70),
|
||||
new Rune(0x256D), new Rune(0x2573), new Rune(0x25CB),
|
||||
|
||||
// 0x78
|
||||
'\u2663', '\u0000', '\u2666', '\u253C', '\u0000', '\u2502', '\u03C0', '\u25E5',
|
||||
new Rune(0x2663), new Rune(0x1FB75), new Rune(0x2666), new Rune(0x253C), new Rune(0x1FB8C),
|
||||
new Rune(0x2502), new Rune(0x03C0), new Rune(0x25E5),
|
||||
|
||||
// 0x80
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x88
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u2028', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x2028),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x90
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x98
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xA0
|
||||
'\u00A0', '\u258C', '\u2584', '\u2594', '\u2581', '\u258E', '\u2592', '\u0000',
|
||||
new Rune(0x00A0), new Rune(0x258C), new Rune(0x2584), new Rune(0x2594), new Rune(0x2581), new Rune(0x258E),
|
||||
new Rune(0x2592), new Rune(0x2595),
|
||||
|
||||
// 0xA8
|
||||
'\u0000', '\u25E4', '\u258A', '\u251C', '\u2597', '\u2514', '\u2510', '\u2582',
|
||||
new Rune(0x1FB8F), new Rune(0x25E4), new Rune(0x1FB87), new Rune(0x251C), new Rune(0x2597),
|
||||
new Rune(0x2514), new Rune(0x2510), new Rune(0x2582),
|
||||
|
||||
// 0xB0
|
||||
'\u250C', '\u2534', '\u252C', '\u2524', '\u258E', '\u258D', '\u0000', '\u0000',
|
||||
new Rune(0x250C), new Rune(0x2534), new Rune(0x252C), new Rune(0x2524), new Rune(0x258E), new Rune(0x258D),
|
||||
new Rune(0x1FB88), new Rune(0x1FB82),
|
||||
|
||||
// 0xB8
|
||||
'\u0000', '\u2583', '\u0000', '\u2596', '\u259D', '\u2518', '\u2598', '\u259A',
|
||||
new Rune(0x1FB83), new Rune(0x2583), new Rune(0x1FB7F), new Rune(0x2596), new Rune(0x259D),
|
||||
new Rune(0x2518), new Rune(0x2598), new Rune(0x259A),
|
||||
|
||||
// 0xC0 (repeats 0x60 - 0x67)
|
||||
'\u2500', '\u2660', '\u2502', '\u2500', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x1FB79), new Rune(0x2660), new Rune(0x1FB72), new Rune(0x1FB78), new Rune(0x1FB77),
|
||||
new Rune(0x1FB76), new Rune(0x1FB7A), new Rune(0x1FB71),
|
||||
|
||||
// 0xC8 (repeats 0x68 - 0x6F)
|
||||
'\u0000', '\u256E', '\u2570', '\u256F', '\u0000', '\u2572', '\u2571', '\u0000',
|
||||
new Rune(0x1FB74), new Rune(0x256E), new Rune(0x2570), new Rune(0x256F), new Rune(0x1FB7C),
|
||||
new Rune(0x2572), new Rune(0x2571), new Rune(0x1FB7D),
|
||||
|
||||
// 0xD0 (repeats 0x70 - 0x77)
|
||||
'\u0000', '\u2022', '\u0000', '\u2665', '\u0000', '\u256D', '\u2573', '\u25CB',
|
||||
new Rune(0x1FB7E), new Rune(0x25CF), new Rune(0x1FB7B), new Rune(0x2665), new Rune(0x1FB70),
|
||||
new Rune(0x256D), new Rune(0x2573), new Rune(0x25CB),
|
||||
|
||||
// 0xD8 (repeats 0x78 - 0x7F)
|
||||
'\u2663', '\u0000', '\u2666', '\u253C', '\u0000', '\u2502', '\u03C0', '\u25E5',
|
||||
new Rune(0x2663), new Rune(0x1FB75), new Rune(0x2666), new Rune(0x253C), new Rune(0x1FB8C),
|
||||
new Rune(0x2502), new Rune(0x03C0), new Rune(0x25E5),
|
||||
|
||||
// 0xE0 (repeats 0xA0 - 0xA7)
|
||||
'\u00A0', '\u258C', '\u2584', '\u2594', '\u2581', '\u258E', '\u2592', '\u0000',
|
||||
new Rune(0x00A0), new Rune(0x258C), new Rune(0x2584), new Rune(0x2594), new Rune(0x2581), new Rune(0x258E),
|
||||
new Rune(0x2592), new Rune(0x2595),
|
||||
|
||||
// 0xE8 (repeats 0xA8 - 0xAF)
|
||||
'\u0000', '\u25E4', '\u258A', '\u251C', '\u2597', '\u2514', '\u2510', '\u2582',
|
||||
new Rune(0x1FB8F), new Rune(0x25E4), new Rune(0x1FB87), new Rune(0x251C), new Rune(0x2597),
|
||||
new Rune(0x2514), new Rune(0x2510), new Rune(0x2582),
|
||||
|
||||
// 0xF0 (repeats 0xB0 - 0xB7)
|
||||
'\u250C', '\u2534', '\u252C', '\u2524', '\u258E', '\u258D', '\u0000', '\u0000',
|
||||
new Rune(0x250C), new Rune(0x2534), new Rune(0x252C), new Rune(0x2524), new Rune(0x258E), new Rune(0x258D),
|
||||
new Rune(0x1FB88), new Rune(0x1FB82),
|
||||
|
||||
// 0xF8 (repeats 0xB8 - 0xBF)
|
||||
'\u0000', '\u2583', '\u0000', '\u2596', '\u259D', '\u2518', '\u2598', '\u259A'
|
||||
new Rune(0x1FB83), new Rune(0x2583), new Rune(0x1FB7F), new Rune(0x2596), new Rune(0x259D),
|
||||
new Rune(0x2518), new Rune(0x2598), new Rune(0x259A)
|
||||
};
|
||||
|
||||
/// <summary>Converts a Unicode character to an PETSCII character</summary>
|
||||
/// <returns>PETSCII character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(Rune character)
|
||||
{
|
||||
if(character == 0x0000)
|
||||
if(character.Value == 0x0000)
|
||||
return 0x3F;
|
||||
|
||||
for(int i = 0; i < 256; i++)
|
||||
|
||||
@@ -31,19 +31,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an Radix-50 (PDP-11) character encoding of Unicode characters.</summary>
|
||||
public class Radix50 : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "radix50";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Western European (Radix-50)";
|
||||
public override string HeaderName => "radix50";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "radix50";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Western European (Radix-50)";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "radix50";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => false;
|
||||
public override bool IsSingleByte => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => false;
|
||||
|
||||
/// <summary>The Radix-50 to Unicode character map, when bits are shifted right</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -289,54 +301,49 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an Apple II character</summary>
|
||||
/// <returns>Apple II character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0020': return 0x00;
|
||||
case '\u0041': return 0x01;
|
||||
case '\u0042': return 0x02;
|
||||
case '\u0043': return 0x03;
|
||||
case '\u0044': return 0x04;
|
||||
case '\u0045': return 0x05;
|
||||
case '\u0046': return 0x06;
|
||||
case '\u0047': return 0x07;
|
||||
case '\u0048': return 0x08;
|
||||
case '\u0049': return 0x09;
|
||||
case '\u004A': return 0x0A;
|
||||
case '\u004B': return 0x0B;
|
||||
case '\u004C': return 0x0C;
|
||||
case '\u004D': return 0x0D;
|
||||
case '\u004E': return 0x0E;
|
||||
case '\u004F': return 0x0F;
|
||||
case '\u0050': return 0x10;
|
||||
case '\u0051': return 0x11;
|
||||
case '\u0052': return 0x12;
|
||||
case '\u0053': return 0x13;
|
||||
case '\u0054': return 0x14;
|
||||
case '\u0055': return 0x15;
|
||||
case '\u0056': return 0x16;
|
||||
case '\u0057': return 0x17;
|
||||
case '\u0058': return 0x18;
|
||||
case '\u0059': return 0x19;
|
||||
case '\u005A': return 0x1A;
|
||||
case '\u0024': return 0x1B;
|
||||
case '\u002E': return 0x1C;
|
||||
case '\u0025': return 0x1D;
|
||||
case '\u0030': return 0x1E;
|
||||
case '\u0031': return 0x1F;
|
||||
case '\u0032': return 0x20;
|
||||
case '\u0033': return 0x21;
|
||||
case '\u0034': return 0x22;
|
||||
case '\u0035': return 0x23;
|
||||
case '\u0036': return 0x24;
|
||||
case '\u0037': return 0x25;
|
||||
case '\u0038': return 0x26;
|
||||
case '\u0039': return 0x27;
|
||||
default:
|
||||
// Fallback to '.'
|
||||
return 0x1C;
|
||||
}
|
||||
}
|
||||
'\u0020' => 0x00,
|
||||
'\u0041' => 0x01,
|
||||
'\u0042' => 0x02,
|
||||
'\u0043' => 0x03,
|
||||
'\u0044' => 0x04,
|
||||
'\u0045' => 0x05,
|
||||
'\u0046' => 0x06,
|
||||
'\u0047' => 0x07,
|
||||
'\u0048' => 0x08,
|
||||
'\u0049' => 0x09,
|
||||
'\u004A' => 0x0A,
|
||||
'\u004B' => 0x0B,
|
||||
'\u004C' => 0x0C,
|
||||
'\u004D' => 0x0D,
|
||||
'\u004E' => 0x0E,
|
||||
'\u004F' => 0x0F,
|
||||
'\u0050' => 0x10,
|
||||
'\u0051' => 0x11,
|
||||
'\u0052' => 0x12,
|
||||
'\u0053' => 0x13,
|
||||
'\u0054' => 0x14,
|
||||
'\u0055' => 0x15,
|
||||
'\u0056' => 0x16,
|
||||
'\u0057' => 0x17,
|
||||
'\u0058' => 0x18,
|
||||
'\u0059' => 0x19,
|
||||
'\u005A' => 0x1A,
|
||||
'\u0024' => 0x1B,
|
||||
'\u002E' => 0x1C,
|
||||
'\u0025' => 0x1D,
|
||||
'\u0030' => 0x1E,
|
||||
'\u0031' => 0x1F,
|
||||
'\u0032' => 0x20,
|
||||
'\u0033' => 0x21,
|
||||
'\u0034' => 0x22,
|
||||
'\u0035' => 0x23,
|
||||
'\u0036' => 0x24,
|
||||
'\u0037' => 0x25,
|
||||
'\u0038' => 0x26,
|
||||
'\u0039' => 0x27,
|
||||
_ => 0x1C
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,9 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
public abstract class SingleByteEncoding : Encoding
|
||||
{
|
||||
/// <summary>
|
||||
/// Character conversion table
|
||||
/// </summary>
|
||||
protected abstract char[] CharTable { get; }
|
||||
|
||||
/// <summary>Gets a value indicating whether the current encoding can be used by browser clients for displaying content.</summary>
|
||||
|
||||
@@ -11,6 +11,9 @@ namespace Claunia.Encoding
|
||||
/// </summary>
|
||||
public abstract class SingleByteEncodingWithRunes : Encoding
|
||||
{
|
||||
/// <summary>
|
||||
/// Rune conversion table
|
||||
/// </summary>
|
||||
protected abstract Rune[] CharTable { get; }
|
||||
|
||||
/// <summary>Gets a value indicating whether the current encoding can be used by browser clients for displaying content.</summary>
|
||||
|
||||
@@ -24,209 +24,255 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace Claunia.Encoding
|
||||
{
|
||||
/// <summary>Represents a ZX80 character encoding of Unicode characters.</summary>
|
||||
public class Zx80 : SingleByteEncoding
|
||||
public class Zx80 : SingleByteEncodingWithRunes
|
||||
{
|
||||
public override string BodyName => "zx80";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Sinclair ZX80 character set";
|
||||
public override string HeaderName => "zx80";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "zx80";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Sinclair ZX80 character set";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "zx80";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => false;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The ZX80 to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
protected override Rune[] CharTable => new[]
|
||||
{
|
||||
// 0x00
|
||||
'\u0020', '\u0022', '\u258C', '\u2584', '\u2598', '\u259D', '\u2596', '\u2597',
|
||||
new Rune(0x0020), new Rune(0x0022), new Rune(0x258C), new Rune(0x2584), new Rune(0x2598), new Rune(0x259D),
|
||||
new Rune(0x2596), new Rune(0x2597),
|
||||
|
||||
// 0x08
|
||||
'\u259E', '\u2592', '\uFFFD', '\uFFFD', '\u00A3', '\u0024', '\u003A', '\u003F',
|
||||
new Rune(0x259E), new Rune(0x2592), new Rune(0x1FB8F), new Rune(0x1FB8E), new Rune(0x00A3),
|
||||
new Rune(0x0024), new Rune(0x003A), new Rune(0x003F),
|
||||
|
||||
// 0x10
|
||||
'\u0028', '\u0029', '\u002D', '\u002B', '\u002A', '\u002F', '\u003D', '\u003E',
|
||||
new Rune(0x0028), new Rune(0x0029), new Rune(0x002D), new Rune(0x002B), new Rune(0x002A), new Rune(0x002F),
|
||||
new Rune(0x003D), new Rune(0x003E),
|
||||
|
||||
// 0x18
|
||||
'\u003C', '\u003B', '\u002C', '\u002E', '\u0030', '\u0031', '\u0032', '\u0033',
|
||||
new Rune(0x003C), new Rune(0x003B), new Rune(0x002C), new Rune(0x002E), new Rune(0x0030), new Rune(0x0031),
|
||||
new Rune(0x0032), new Rune(0x0033),
|
||||
|
||||
// 0x20
|
||||
'\u0034', '\u0035', '\u0036', '\u0037', '\u0038', '\u0039', '\u0041', '\u0042',
|
||||
new Rune(0x0034), new Rune(0x0035), new Rune(0x0036), new Rune(0x0037), new Rune(0x0038), new Rune(0x0039),
|
||||
new Rune(0x0041), new Rune(0x0042),
|
||||
|
||||
// 0x28
|
||||
'\u0043', '\u0044', '\u0045', '\u0046', '\u0047', '\u0048', '\u0049', '\u004A',
|
||||
new Rune(0x0043), new Rune(0x0044), new Rune(0x0045), new Rune(0x0046), new Rune(0x0047), new Rune(0x0048),
|
||||
new Rune(0x0049), new Rune(0x004A),
|
||||
|
||||
// 0x30
|
||||
'\u004B', '\u004C', '\u004D', '\u004E', '\u004F', '\u0050', '\u0051', '\u0052',
|
||||
new Rune(0x004B), new Rune(0x004C), new Rune(0x004D), new Rune(0x004E), new Rune(0x004F), new Rune(0x0050),
|
||||
new Rune(0x0051), new Rune(0x0052),
|
||||
|
||||
// 0x38
|
||||
'\u0053', '\u0054', '\u0055', '\u0056', '\u0057', '\u0058', '\u0059', '\u005A',
|
||||
new Rune(0x0053), new Rune(0x0054), new Rune(0x0055), new Rune(0x0056), new Rune(0x0057), new Rune(0x0058),
|
||||
new Rune(0x0059), new Rune(0x005A),
|
||||
|
||||
// 0x40
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x48
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x50
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x58
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x60
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x68
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x70
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\u000D', '\uFFFD', '\u000A', '\u0008',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0x000D), new Rune(0xFFFD),
|
||||
new Rune(0x000A), new Rune(0x0008),
|
||||
|
||||
// 0x78
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x80
|
||||
'\u2588', '\uFFFD', '\u2590', '\u2580', '\u2599', '\u259C', '\u259B', '\u259A',
|
||||
new Rune(0x2588), new Rune(0xFFFD), new Rune(0x2590), new Rune(0x2580), new Rune(0x2599), new Rune(0x259C),
|
||||
new Rune(0x259B), new Rune(0x259A),
|
||||
|
||||
// 0x88
|
||||
'\u2592', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0x2592), new Rune(0x1FB90), new Rune(0x1FB91), new Rune(0x1FB92), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0x90
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0x98
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0xA0
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0xA8
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0xB0
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0xB8
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0xC0
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xC8
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0xD0
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0xD8
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0xE0
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0xE8
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0xF0
|
||||
'\uFFFF', '\u0000', '\u0000', '\uFFFF', '\uFFFF', '\u0000', '\uFFFF', '\uFFFF',
|
||||
new Rune(0xFFFF), new Rune(0x0000), new Rune(0x0000), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0x0000),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0xF8
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\u0000'
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0x0000)
|
||||
};
|
||||
|
||||
/// <summary>Converts a Unicode character to an ZX80 character</summary>
|
||||
/// <returns>ZX80 character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(Rune character) => character.Value switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0020': return 0x00;
|
||||
case '\u0022': return 0x01;
|
||||
case '\u258C': return 0x02;
|
||||
case '\u2584': return 0x03;
|
||||
case '\u2598': return 0x04;
|
||||
case '\u259D': return 0x05;
|
||||
case '\u2596': return 0x06;
|
||||
case '\u2597': return 0x07;
|
||||
case '\u259E': return 0x08;
|
||||
case '\u2592': return 0x09;
|
||||
case '\u00A3': return 0x0C;
|
||||
case '\u0024': return 0x0D;
|
||||
case '\u003A': return 0x0E;
|
||||
case '\u003F': return 0x0F;
|
||||
case '\u0028': return 0x10;
|
||||
case '\u0029': return 0x11;
|
||||
case '\u002D': return 0x12;
|
||||
case '\u002B': return 0x13;
|
||||
case '\u002A': return 0x14;
|
||||
case '\u002F': return 0x15;
|
||||
case '\u003D': return 0x16;
|
||||
case '\u003E': return 0x17;
|
||||
case '\u003C': return 0x18;
|
||||
case '\u003B': return 0x19;
|
||||
case '\u002C': return 0x1A;
|
||||
case '\u002E': return 0x1B;
|
||||
case '\u0030': return 0x1C;
|
||||
case '\u0031': return 0x1D;
|
||||
case '\u0032': return 0x1E;
|
||||
case '\u0033': return 0x1F;
|
||||
case '\u0034': return 0x20;
|
||||
case '\u0035': return 0x21;
|
||||
case '\u0036': return 0x22;
|
||||
case '\u0037': return 0x23;
|
||||
case '\u0038': return 0x24;
|
||||
case '\u0039': return 0x25;
|
||||
case '\u0041': return 0x26;
|
||||
case '\u0042': return 0x27;
|
||||
case '\u0043': return 0x28;
|
||||
case '\u0044': return 0x29;
|
||||
case '\u0045': return 0x2A;
|
||||
case '\u0046': return 0x2B;
|
||||
case '\u0047': return 0x2C;
|
||||
case '\u0048': return 0x2D;
|
||||
case '\u0049': return 0x2E;
|
||||
case '\u004A': return 0x2F;
|
||||
case '\u004B': return 0x30;
|
||||
case '\u004C': return 0x31;
|
||||
case '\u004D': return 0x32;
|
||||
case '\u004E': return 0x33;
|
||||
case '\u004F': return 0x34;
|
||||
case '\u0050': return 0x35;
|
||||
case '\u0051': return 0x36;
|
||||
case '\u0052': return 0x37;
|
||||
case '\u0053': return 0x38;
|
||||
case '\u0054': return 0x39;
|
||||
case '\u0055': return 0x3A;
|
||||
case '\u0056': return 0x3B;
|
||||
case '\u0057': return 0x3C;
|
||||
case '\u0058': return 0x3D;
|
||||
case '\u0059': return 0x3E;
|
||||
case '\u005A': return 0x3F;
|
||||
case '\u000D': return 0x74;
|
||||
case '\u000A': return 0x76;
|
||||
case '\u0008': return 0x77;
|
||||
case '\u2588': return 0x80;
|
||||
case '\u2590': return 0x82;
|
||||
case '\u2580': return 0x83;
|
||||
case '\u259F': return 0x84;
|
||||
case '\u2599': return 0x85;
|
||||
case '\u259C': return 0x86;
|
||||
case '\u259B': return 0x87;
|
||||
case '\u259A': return 0x88;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x0F;
|
||||
}
|
||||
}
|
||||
0x0020 => 0x00,
|
||||
0x0022 => 0x01,
|
||||
0x258C => 0x02,
|
||||
0x2584 => 0x03,
|
||||
0x2598 => 0x04,
|
||||
0x259D => 0x05,
|
||||
0x2596 => 0x06,
|
||||
0x2597 => 0x07,
|
||||
0x259E => 0x08,
|
||||
0x2592 => 0x09,
|
||||
0x1FB8F => 0x0A,
|
||||
0x1FB8E => 0x0B,
|
||||
0x00A3 => 0x0C,
|
||||
0x0024 => 0x0D,
|
||||
0x003A => 0x0E,
|
||||
0x003F => 0x0F,
|
||||
0x0028 => 0x10,
|
||||
0x0029 => 0x11,
|
||||
0x002D => 0x12,
|
||||
0x002B => 0x13,
|
||||
0x002A => 0x14,
|
||||
0x002F => 0x15,
|
||||
0x003D => 0x16,
|
||||
0x003E => 0x17,
|
||||
0x003C => 0x18,
|
||||
0x003B => 0x19,
|
||||
0x002C => 0x1A,
|
||||
0x002E => 0x1B,
|
||||
0x0030 => 0x1C,
|
||||
0x0031 => 0x1D,
|
||||
0x0032 => 0x1E,
|
||||
0x0033 => 0x1F,
|
||||
0x0034 => 0x20,
|
||||
0x0035 => 0x21,
|
||||
0x0036 => 0x22,
|
||||
0x0037 => 0x23,
|
||||
0x0038 => 0x24,
|
||||
0x0039 => 0x25,
|
||||
0x0041 => 0x26,
|
||||
0x0042 => 0x27,
|
||||
0x0043 => 0x28,
|
||||
0x0044 => 0x29,
|
||||
0x0045 => 0x2A,
|
||||
0x0046 => 0x2B,
|
||||
0x0047 => 0x2C,
|
||||
0x0048 => 0x2D,
|
||||
0x0049 => 0x2E,
|
||||
0x004A => 0x2F,
|
||||
0x004B => 0x30,
|
||||
0x004C => 0x31,
|
||||
0x004D => 0x32,
|
||||
0x004E => 0x33,
|
||||
0x004F => 0x34,
|
||||
0x0050 => 0x35,
|
||||
0x0051 => 0x36,
|
||||
0x0052 => 0x37,
|
||||
0x0053 => 0x38,
|
||||
0x0054 => 0x39,
|
||||
0x0055 => 0x3A,
|
||||
0x0056 => 0x3B,
|
||||
0x0057 => 0x3C,
|
||||
0x0058 => 0x3D,
|
||||
0x0059 => 0x3E,
|
||||
0x005A => 0x3F,
|
||||
0x000D => 0x74,
|
||||
0x000A => 0x76,
|
||||
0x0008 => 0x77,
|
||||
0x2588 => 0x80,
|
||||
0x2590 => 0x82,
|
||||
0x2580 => 0x83,
|
||||
0x259F => 0x84,
|
||||
0x2599 => 0x85,
|
||||
0x259C => 0x86,
|
||||
0x259B => 0x87,
|
||||
0x259A => 0x88,
|
||||
0x1FB90 => 0x89,
|
||||
0x1FB91 => 0x8A,
|
||||
0x1FB92 => 0x8B,
|
||||
_ => 0x0F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -24,209 +24,255 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace Claunia.Encoding
|
||||
{
|
||||
/// <summary>Represents a ZX81 character encoding of Unicode characters.</summary>
|
||||
public class Zx81 : SingleByteEncoding
|
||||
public class Zx81 : SingleByteEncodingWithRunes
|
||||
{
|
||||
public override string BodyName => "zx81";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Sinclair ZX81 character set";
|
||||
public override string HeaderName => "zx81";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "zx81";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Sinclair ZX81 character set";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "zx81";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => false;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The ZX81 to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
protected override Rune[] CharTable => new[]
|
||||
{
|
||||
// 0x00
|
||||
'\u0020', '\u2598', '\u259D', '\u2580', '\u2596', '\u258C', '\u259E', '\u259B',
|
||||
new Rune(0x0020), new Rune(0x2598), new Rune(0x259D), new Rune(0x2580), new Rune(0x2596), new Rune(0x258C),
|
||||
new Rune(0x259E), new Rune(0x259B),
|
||||
|
||||
// 0x08
|
||||
'\u2592', '\uFFFD', '\uFFFD', '\u0022', '\u00A3', '\u0024', '\u003A', '\u003F',
|
||||
new Rune(0x2592), new Rune(0x1FB8F), new Rune(0x1FB8E), new Rune(0x0022), new Rune(0x00A3),
|
||||
new Rune(0x0024), new Rune(0x003A), new Rune(0x003F),
|
||||
|
||||
// 0x10
|
||||
'\u0028', '\u0029', '\u003E', '\u003C', '\u003D', '\u002B', '\u002D', '\u002A',
|
||||
new Rune(0x0028), new Rune(0x0029), new Rune(0x003E), new Rune(0x003C), new Rune(0x003D), new Rune(0x002B),
|
||||
new Rune(0x002D), new Rune(0x002A),
|
||||
|
||||
// 0x18
|
||||
'\u002F', '\u003B', '\u002C', '\u002E', '\u0030', '\u0031', '\u0032', '\u0033',
|
||||
new Rune(0x002F), new Rune(0x003B), new Rune(0x002C), new Rune(0x002E), new Rune(0x0030), new Rune(0x0031),
|
||||
new Rune(0x0032), new Rune(0x0033),
|
||||
|
||||
// 0x20
|
||||
'\u0034', '\u0035', '\u0036', '\u0037', '\u0038', '\u0039', '\u0041', '\u0042',
|
||||
new Rune(0x0034), new Rune(0x0035), new Rune(0x0036), new Rune(0x0037), new Rune(0x0038), new Rune(0x0039),
|
||||
new Rune(0x0041), new Rune(0x0042),
|
||||
|
||||
// 0x28
|
||||
'\u0043', '\u0044', '\u0045', '\u0046', '\u0047', '\u0048', '\u0049', '\u004A',
|
||||
new Rune(0x0043), new Rune(0x0044), new Rune(0x0045), new Rune(0x0046), new Rune(0x0047), new Rune(0x0048),
|
||||
new Rune(0x0049), new Rune(0x004A),
|
||||
|
||||
// 0x30
|
||||
'\u004B', '\u004C', '\u004D', '\u004E', '\u004F', '\u0050', '\u0051', '\u0052',
|
||||
new Rune(0x004B), new Rune(0x004C), new Rune(0x004D), new Rune(0x004E), new Rune(0x004F), new Rune(0x0050),
|
||||
new Rune(0x0051), new Rune(0x0052),
|
||||
|
||||
// 0x38
|
||||
'\u0053', '\u0054', '\u0055', '\u0056', '\u0057', '\u0058', '\u0059', '\u005A',
|
||||
new Rune(0x0053), new Rune(0x0054), new Rune(0x0055), new Rune(0x0056), new Rune(0x0057), new Rune(0x0058),
|
||||
new Rune(0x0059), new Rune(0x005A),
|
||||
|
||||
// 0x40
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x48
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x50
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x58
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x60
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x68
|
||||
'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000',
|
||||
new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0x0000), new Rune(0x0000),
|
||||
|
||||
// 0x70
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\u000A', '\u0008',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0x000A), new Rune(0x0008),
|
||||
|
||||
// 0x78
|
||||
'\uFFFF', '\uFFFF', '\u0000', '\u0000', '\u0000', '\u0000', '\uFFFF', '\uFFFF',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000), new Rune(0x0000),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0x80
|
||||
'\u2588', '\u259F', '\u2599', '\u2584', '\u259C', '\u2590', '\u259A', '\u2597',
|
||||
new Rune(0x2588), new Rune(0x259F), new Rune(0x2599), new Rune(0x2584), new Rune(0x259C), new Rune(0x2590),
|
||||
new Rune(0x259A), new Rune(0x2597),
|
||||
|
||||
// 0x88
|
||||
'\u2592', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0x1FB90), new Rune(0x1FB91), new Rune(0x1FB92), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0x90
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0x98
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0xA0
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0xA8
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0xB0
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0xB8
|
||||
'\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD', '\uFFFD',
|
||||
new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
new Rune(0xFFFD), new Rune(0xFFFD),
|
||||
|
||||
// 0xC0
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\u0000', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0x0000), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0xC8
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0xD0
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0xD8
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0xE0
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0xE8
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0xF0
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF',
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
|
||||
// 0xF8
|
||||
'\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF', '\uFFFF'
|
||||
new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF), new Rune(0xFFFF),
|
||||
new Rune(0xFFFF), new Rune(0xFFFF)
|
||||
};
|
||||
|
||||
/// <summary>Converts a Unicode character to an ZX81 character</summary>
|
||||
/// <returns>ZX81 character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(Rune character) => character.Value switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0020': return 0x00;
|
||||
case '\u2598': return 0x01;
|
||||
case '\u259D': return 0x02;
|
||||
case '\u2580': return 0x03;
|
||||
case '\u2596': return 0x04;
|
||||
case '\u258C': return 0x05;
|
||||
case '\u259E': return 0x06;
|
||||
case '\u259B': return 0x07;
|
||||
case '\u2592': return 0x08;
|
||||
case '\u0022': return 0x0B;
|
||||
case '\u00A3': return 0x0C;
|
||||
case '\u0024': return 0x0D;
|
||||
case '\u003A': return 0x0E;
|
||||
case '\u003F': return 0x0F;
|
||||
case '\u0028': return 0x10;
|
||||
case '\u0029': return 0x11;
|
||||
case '\u003E': return 0x12;
|
||||
case '\u003C': return 0x13;
|
||||
case '\u003D': return 0x14;
|
||||
case '\u002B': return 0x15;
|
||||
case '\u002D': return 0x16;
|
||||
case '\u002A': return 0x17;
|
||||
case '\u002F': return 0x18;
|
||||
case '\u003B': return 0x19;
|
||||
case '\u002C': return 0x1A;
|
||||
case '\u002E': return 0x1B;
|
||||
case '\u0030': return 0x1C;
|
||||
case '\u0031': return 0x1D;
|
||||
case '\u0032': return 0x1E;
|
||||
case '\u0033': return 0x1F;
|
||||
case '\u0034': return 0x20;
|
||||
case '\u0035': return 0x21;
|
||||
case '\u0036': return 0x22;
|
||||
case '\u0037': return 0x23;
|
||||
case '\u0038': return 0x24;
|
||||
case '\u0039': return 0x25;
|
||||
case '\u0041': return 0x26;
|
||||
case '\u0042': return 0x27;
|
||||
case '\u0043': return 0x28;
|
||||
case '\u0044': return 0x29;
|
||||
case '\u0045': return 0x2A;
|
||||
case '\u0046': return 0x2B;
|
||||
case '\u0047': return 0x2C;
|
||||
case '\u0048': return 0x2D;
|
||||
case '\u0049': return 0x2E;
|
||||
case '\u004A': return 0x2F;
|
||||
case '\u004B': return 0x30;
|
||||
case '\u004C': return 0x31;
|
||||
case '\u004D': return 0x32;
|
||||
case '\u004E': return 0x33;
|
||||
case '\u004F': return 0x34;
|
||||
case '\u0050': return 0x35;
|
||||
case '\u0051': return 0x36;
|
||||
case '\u0052': return 0x37;
|
||||
case '\u0053': return 0x38;
|
||||
case '\u0054': return 0x39;
|
||||
case '\u0055': return 0x3A;
|
||||
case '\u0056': return 0x3B;
|
||||
case '\u0057': return 0x3C;
|
||||
case '\u0058': return 0x3D;
|
||||
case '\u0059': return 0x3E;
|
||||
case '\u005A': return 0x3F;
|
||||
case '\u000D': return 0x74;
|
||||
case '\u000A': return 0x76;
|
||||
case '\u0008': return 0x77;
|
||||
case '\u2588': return 0x80;
|
||||
case '\u259F': return 0x81;
|
||||
case '\u2599': return 0x82;
|
||||
case '\u2584': return 0x83;
|
||||
case '\u259C': return 0x84;
|
||||
case '\u2590': return 0x85;
|
||||
case '\u259A': return 0x86;
|
||||
case '\u2597': return 0x87;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x0F;
|
||||
}
|
||||
}
|
||||
0x0020 => 0x00,
|
||||
0x2598 => 0x01,
|
||||
0x259D => 0x02,
|
||||
0x2580 => 0x03,
|
||||
0x2596 => 0x04,
|
||||
0x258C => 0x05,
|
||||
0x259E => 0x06,
|
||||
0x259B => 0x07,
|
||||
0x2592 => 0x08,
|
||||
0x1FB8F => 0x09,
|
||||
0x1FB8E => 0x0A,
|
||||
0x0022 => 0x0B,
|
||||
0x00A3 => 0x0C,
|
||||
0x0024 => 0x0D,
|
||||
0x003A => 0x0E,
|
||||
0x003F => 0x0F,
|
||||
0x0028 => 0x10,
|
||||
0x0029 => 0x11,
|
||||
0x003E => 0x12,
|
||||
0x003C => 0x13,
|
||||
0x003D => 0x14,
|
||||
0x002B => 0x15,
|
||||
0x002D => 0x16,
|
||||
0x002A => 0x17,
|
||||
0x002F => 0x18,
|
||||
0x003B => 0x19,
|
||||
0x002C => 0x1A,
|
||||
0x002E => 0x1B,
|
||||
0x0030 => 0x1C,
|
||||
0x0031 => 0x1D,
|
||||
0x0032 => 0x1E,
|
||||
0x0033 => 0x1F,
|
||||
0x0034 => 0x20,
|
||||
0x0035 => 0x21,
|
||||
0x0036 => 0x22,
|
||||
0x0037 => 0x23,
|
||||
0x0038 => 0x24,
|
||||
0x0039 => 0x25,
|
||||
0x0041 => 0x26,
|
||||
0x0042 => 0x27,
|
||||
0x0043 => 0x28,
|
||||
0x0044 => 0x29,
|
||||
0x0045 => 0x2A,
|
||||
0x0046 => 0x2B,
|
||||
0x0047 => 0x2C,
|
||||
0x0048 => 0x2D,
|
||||
0x0049 => 0x2E,
|
||||
0x004A => 0x2F,
|
||||
0x004B => 0x30,
|
||||
0x004C => 0x31,
|
||||
0x004D => 0x32,
|
||||
0x004E => 0x33,
|
||||
0x004F => 0x34,
|
||||
0x0050 => 0x35,
|
||||
0x0051 => 0x36,
|
||||
0x0052 => 0x37,
|
||||
0x0053 => 0x38,
|
||||
0x0054 => 0x39,
|
||||
0x0055 => 0x3A,
|
||||
0x0056 => 0x3B,
|
||||
0x0057 => 0x3C,
|
||||
0x0058 => 0x3D,
|
||||
0x0059 => 0x3E,
|
||||
0x005A => 0x3F,
|
||||
0x000D => 0x74,
|
||||
0x000A => 0x76,
|
||||
0x0008 => 0x77,
|
||||
0x2588 => 0x80,
|
||||
0x259F => 0x81,
|
||||
0x2599 => 0x82,
|
||||
0x2584 => 0x83,
|
||||
0x259C => 0x84,
|
||||
0x2590 => 0x85,
|
||||
0x259A => 0x86,
|
||||
0x2597 => 0x87,
|
||||
0x1FB90 => 0x88,
|
||||
0x1FB91 => 0x89,
|
||||
0x1FB92 => 0x8A,
|
||||
_ => 0x0F
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -29,19 +29,31 @@ namespace Claunia.Encoding
|
||||
/// <summary>Represents an ZX Spectrum character encoding of Unicode characters.</summary>
|
||||
public class ZxSpectrum : SingleByteEncoding
|
||||
{
|
||||
public override string BodyName => "spectrum";
|
||||
public override int CodePage => 0;
|
||||
public override string EncodingName => "Sinclair ZX Spectrum character set";
|
||||
public override string HeaderName => "spectrum";
|
||||
public override string WebName => "";
|
||||
public override int WindowsCodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string BodyName => "spectrum";
|
||||
/// <inheritdoc />
|
||||
public override int CodePage => 0;
|
||||
/// <inheritdoc />
|
||||
public override string EncodingName => "Sinclair ZX Spectrum character set";
|
||||
/// <inheritdoc />
|
||||
public override string HeaderName => "spectrum";
|
||||
/// <inheritdoc />
|
||||
public override string WebName => "";
|
||||
/// <inheritdoc />
|
||||
public override int WindowsCodePage => 0;
|
||||
|
||||
public override bool IsBrowserDisplay => false;
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserDisplay => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsBrowserSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsDisplay => false;
|
||||
public override bool IsMailNewsSave => false;
|
||||
public override bool IsReadOnly => false;
|
||||
public override bool IsSingleByte => true;
|
||||
/// <inheritdoc />
|
||||
public override bool IsMailNewsSave => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsReadOnly => false;
|
||||
/// <inheritdoc />
|
||||
public override bool IsSingleByte => true;
|
||||
|
||||
/// <summary>The ZX Spectrum to Unicode character map.</summary>
|
||||
protected override char[] CharTable => new[]
|
||||
@@ -146,127 +158,122 @@ namespace Claunia.Encoding
|
||||
/// <summary>Converts a Unicode character to an ZX Spectrum character</summary>
|
||||
/// <returns>ZX Spectrum character.</returns>
|
||||
/// <param name="character">Unicode character.</param>
|
||||
private protected override byte GetByte(char character)
|
||||
private protected override byte GetByte(char character) => character switch
|
||||
{
|
||||
switch(character)
|
||||
{
|
||||
case '\u0009': return 0x06;
|
||||
case '\u000D': return 0x0D;
|
||||
case '\u0020': return 0x20;
|
||||
case '\u0021': return 0x21;
|
||||
case '\u0022': return 0x22;
|
||||
case '\u0023': return 0x23;
|
||||
case '\u0024': return 0x24;
|
||||
case '\u0025': return 0x25;
|
||||
case '\u0026': return 0x26;
|
||||
case '\u0027': return 0x27;
|
||||
case '\u0028': return 0x28;
|
||||
case '\u0029': return 0x29;
|
||||
case '\u002A': return 0x2A;
|
||||
case '\u002B': return 0x2B;
|
||||
case '\u002C': return 0x2C;
|
||||
case '\u002D': return 0x2D;
|
||||
case '\u002E': return 0x2E;
|
||||
case '\u002F': return 0x2F;
|
||||
case '\u0030': return 0x30;
|
||||
case '\u0031': return 0x31;
|
||||
case '\u0032': return 0x32;
|
||||
case '\u0033': return 0x33;
|
||||
case '\u0034': return 0x34;
|
||||
case '\u0035': return 0x35;
|
||||
case '\u0036': return 0x36;
|
||||
case '\u0037': return 0x37;
|
||||
case '\u0038': return 0x38;
|
||||
case '\u0039': return 0x39;
|
||||
case '\u003A': return 0x3A;
|
||||
case '\u003B': return 0x3B;
|
||||
case '\u003C': return 0x3C;
|
||||
case '\u003D': return 0x3D;
|
||||
case '\u003E': return 0x3E;
|
||||
case '\u003F': return 0x3F;
|
||||
case '\u0040': return 0x40;
|
||||
case '\u0041': return 0x41;
|
||||
case '\u0042': return 0x42;
|
||||
case '\u0043': return 0x43;
|
||||
case '\u0044': return 0x44;
|
||||
case '\u0045': return 0x45;
|
||||
case '\u0046': return 0x46;
|
||||
case '\u0047': return 0x47;
|
||||
case '\u0048': return 0x48;
|
||||
case '\u0049': return 0x49;
|
||||
case '\u004A': return 0x4A;
|
||||
case '\u004B': return 0x4B;
|
||||
case '\u004C': return 0x4C;
|
||||
case '\u004D': return 0x4D;
|
||||
case '\u004E': return 0x4E;
|
||||
case '\u004F': return 0x4F;
|
||||
case '\u0050': return 0x50;
|
||||
case '\u0051': return 0x51;
|
||||
case '\u0052': return 0x52;
|
||||
case '\u0053': return 0x53;
|
||||
case '\u0054': return 0x54;
|
||||
case '\u0055': return 0x55;
|
||||
case '\u0056': return 0x56;
|
||||
case '\u0057': return 0x57;
|
||||
case '\u0058': return 0x58;
|
||||
case '\u0059': return 0x59;
|
||||
case '\u005A': return 0x5A;
|
||||
case '\u005B': return 0x5B;
|
||||
case '\u005C': return 0x5C;
|
||||
case '\u005D': return 0x5D;
|
||||
case '\u2191': return 0x5E;
|
||||
case '\u005F': return 0x5F;
|
||||
case '\u00A3': return 0x60;
|
||||
case '\u0061': return 0x61;
|
||||
case '\u0062': return 0x62;
|
||||
case '\u0063': return 0x63;
|
||||
case '\u0064': return 0x64;
|
||||
case '\u0065': return 0x65;
|
||||
case '\u0066': return 0x66;
|
||||
case '\u0067': return 0x67;
|
||||
case '\u0068': return 0x68;
|
||||
case '\u0069': return 0x69;
|
||||
case '\u006A': return 0x6A;
|
||||
case '\u006B': return 0x6B;
|
||||
case '\u006C': return 0x6C;
|
||||
case '\u006D': return 0x6D;
|
||||
case '\u006E': return 0x6E;
|
||||
case '\u006F': return 0x6F;
|
||||
case '\u0070': return 0x70;
|
||||
case '\u0071': return 0x71;
|
||||
case '\u0072': return 0x72;
|
||||
case '\u0073': return 0x73;
|
||||
case '\u0074': return 0x74;
|
||||
case '\u0075': return 0x75;
|
||||
case '\u0076': return 0x76;
|
||||
case '\u0077': return 0x77;
|
||||
case '\u0078': return 0x78;
|
||||
case '\u0079': return 0x79;
|
||||
case '\u007A': return 0x7A;
|
||||
case '\u007B': return 0x7B;
|
||||
case '\u007C': return 0x7C;
|
||||
case '\u007D': return 0x7D;
|
||||
case '\u007E': return 0x7E;
|
||||
case '\u00A9': return 0x7F;
|
||||
case '\u259D': return 0x81;
|
||||
case '\u2598': return 0x82;
|
||||
case '\u2580': return 0x83;
|
||||
case '\u2597': return 0x84;
|
||||
case '\u2590': return 0x85;
|
||||
case '\u259A': return 0x86;
|
||||
case '\u259C': return 0x87;
|
||||
case '\u2596': return 0x88;
|
||||
case '\u259E': return 0x89;
|
||||
case '\u258C': return 0x8A;
|
||||
case '\u259B': return 0x8B;
|
||||
case '\u2584': return 0x8C;
|
||||
case '\u259F': return 0x8D;
|
||||
case '\u2599': return 0x8E;
|
||||
case '\u2588': return 0x8F;
|
||||
default:
|
||||
// Fallback to '?'
|
||||
return 0x3F;
|
||||
}
|
||||
}
|
||||
'\u0009' => 0x06,
|
||||
'\u000D' => 0x0D,
|
||||
'\u0020' => 0x20,
|
||||
'\u0021' => 0x21,
|
||||
'\u0022' => 0x22,
|
||||
'\u0023' => 0x23,
|
||||
'\u0024' => 0x24,
|
||||
'\u0025' => 0x25,
|
||||
'\u0026' => 0x26,
|
||||
'\u0027' => 0x27,
|
||||
'\u0028' => 0x28,
|
||||
'\u0029' => 0x29,
|
||||
'\u002A' => 0x2A,
|
||||
'\u002B' => 0x2B,
|
||||
'\u002C' => 0x2C,
|
||||
'\u002D' => 0x2D,
|
||||
'\u002E' => 0x2E,
|
||||
'\u002F' => 0x2F,
|
||||
'\u0030' => 0x30,
|
||||
'\u0031' => 0x31,
|
||||
'\u0032' => 0x32,
|
||||
'\u0033' => 0x33,
|
||||
'\u0034' => 0x34,
|
||||
'\u0035' => 0x35,
|
||||
'\u0036' => 0x36,
|
||||
'\u0037' => 0x37,
|
||||
'\u0038' => 0x38,
|
||||
'\u0039' => 0x39,
|
||||
'\u003A' => 0x3A,
|
||||
'\u003B' => 0x3B,
|
||||
'\u003C' => 0x3C,
|
||||
'\u003D' => 0x3D,
|
||||
'\u003E' => 0x3E,
|
||||
'\u003F' => 0x3F,
|
||||
'\u0040' => 0x40,
|
||||
'\u0041' => 0x41,
|
||||
'\u0042' => 0x42,
|
||||
'\u0043' => 0x43,
|
||||
'\u0044' => 0x44,
|
||||
'\u0045' => 0x45,
|
||||
'\u0046' => 0x46,
|
||||
'\u0047' => 0x47,
|
||||
'\u0048' => 0x48,
|
||||
'\u0049' => 0x49,
|
||||
'\u004A' => 0x4A,
|
||||
'\u004B' => 0x4B,
|
||||
'\u004C' => 0x4C,
|
||||
'\u004D' => 0x4D,
|
||||
'\u004E' => 0x4E,
|
||||
'\u004F' => 0x4F,
|
||||
'\u0050' => 0x50,
|
||||
'\u0051' => 0x51,
|
||||
'\u0052' => 0x52,
|
||||
'\u0053' => 0x53,
|
||||
'\u0054' => 0x54,
|
||||
'\u0055' => 0x55,
|
||||
'\u0056' => 0x56,
|
||||
'\u0057' => 0x57,
|
||||
'\u0058' => 0x58,
|
||||
'\u0059' => 0x59,
|
||||
'\u005A' => 0x5A,
|
||||
'\u005B' => 0x5B,
|
||||
'\u005C' => 0x5C,
|
||||
'\u005D' => 0x5D,
|
||||
'\u2191' => 0x5E,
|
||||
'\u005F' => 0x5F,
|
||||
'\u00A3' => 0x60,
|
||||
'\u0061' => 0x61,
|
||||
'\u0062' => 0x62,
|
||||
'\u0063' => 0x63,
|
||||
'\u0064' => 0x64,
|
||||
'\u0065' => 0x65,
|
||||
'\u0066' => 0x66,
|
||||
'\u0067' => 0x67,
|
||||
'\u0068' => 0x68,
|
||||
'\u0069' => 0x69,
|
||||
'\u006A' => 0x6A,
|
||||
'\u006B' => 0x6B,
|
||||
'\u006C' => 0x6C,
|
||||
'\u006D' => 0x6D,
|
||||
'\u006E' => 0x6E,
|
||||
'\u006F' => 0x6F,
|
||||
'\u0070' => 0x70,
|
||||
'\u0071' => 0x71,
|
||||
'\u0072' => 0x72,
|
||||
'\u0073' => 0x73,
|
||||
'\u0074' => 0x74,
|
||||
'\u0075' => 0x75,
|
||||
'\u0076' => 0x76,
|
||||
'\u0077' => 0x77,
|
||||
'\u0078' => 0x78,
|
||||
'\u0079' => 0x79,
|
||||
'\u007A' => 0x7A,
|
||||
'\u007B' => 0x7B,
|
||||
'\u007C' => 0x7C,
|
||||
'\u007D' => 0x7D,
|
||||
'\u007E' => 0x7E,
|
||||
'\u00A9' => 0x7F,
|
||||
'\u259D' => 0x81,
|
||||
'\u2598' => 0x82,
|
||||
'\u2580' => 0x83,
|
||||
'\u2597' => 0x84,
|
||||
'\u2590' => 0x85,
|
||||
'\u259A' => 0x86,
|
||||
'\u259C' => 0x87,
|
||||
'\u2596' => 0x88,
|
||||
'\u259E' => 0x89,
|
||||
'\u258C' => 0x8A,
|
||||
'\u259B' => 0x8B,
|
||||
'\u2584' => 0x8C,
|
||||
'\u259F' => 0x8D,
|
||||
'\u2599' => 0x8E,
|
||||
'\u2588' => 0x8F,
|
||||
_ => 0x3F
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user