
#include <textencoding/BTextEncoding.h>
#include <textencoding/TextEncodingNames.h>
#include <add-ons/textencoding/BTextCodec.h>
#include <add-ons/textencoding/BEncodingRun.h>
#include <string.h>

using namespace B::TextEncoding;

//#pragma mark -
const BEncodingRun		ISO6_0080(0x0080, 0x00A0, 0x0080);

const uint16	ISO6Block_00AC[] = {
0x060C, 0x00AD
};
const BEncodingRun		ISO6_00AC(0x00AC, 0x00AD, ISO6Block_00AC);

const BEncodingRun		ISO6_00C1(0x00C1, 0x00DA, 0x0621);
const BEncodingRun		ISO6_00E0(0x00E0, 0x00F2, 0x0640);

const BEncodingRun * const ISO6Stack[] = {
&ISO6_0080, &ISO6_00AC, &ISO6_00C1, &ISO6_00E0
};
const uint16 ISO6StackSize = 4;

const BReplacement	ISO6Replace_00A4(0x00A4, 0x00A4);
const BReplacement	ISO6Replace_00BB(0x00BB, 0x061B);
const BReplacement	ISO6Replace_00BF(0x00BF, 0x061F);
const BReplacement * const ISO6Replacements[] = {
&ISO6Replace_00A4, &ISO6Replace_00BB, &ISO6Replace_00BF
};
const uint16 ISO6ReplacementCount = 3;

// pragma mark -


const BEncodingRun		ISO7_0080(0x0080, 0x00A0, 0x0080);
const BEncodingRun		ISO7_00A3(0x00A3, 0x00AD, 0x00A3);

const uint16	ISO7Block_00AF[] = {
0x2015, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7, 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD
};
const BEncodingRun		ISO7_00AF(0x00AF, 0x00BD, ISO7Block_00AF);

const BEncodingRun		ISO7_00BE(0x00BE, 0x00D1, 0x038E);
const BEncodingRun		ISO7_00D3(0x00D3, 0x00FE, 0x03A3);

const BEncodingRun * const ISO7Stack[] = {
&ISO7_0080, &ISO7_00AF, &ISO7_00BE, &ISO7_00D3
};
const uint16 ISO7StackSize = 4;

const BReplacement	ISO7Replace_00A1(0x00A1, 0x2018);
const BReplacement	ISO7Replace_00A2(0x00A2, 0x2019);
const BReplacement	ISO7Replace_00A4(0x00A4, 0xFFFF);
const BReplacement	ISO7Replace_00A5(0x00A5, 0xFFFF);
const BReplacement	ISO7Replace_00AA(0x00AA, 0xFFFF);

const BReplacement * const ISO7Replacements [] = {
&ISO7Replace_00A1, &ISO7Replace_00A2, &ISO7Replace_00A4, &ISO7Replace_00A5, &ISO7Replace_00AA
};
const uint16 ISO7ReplaceCount = 5;

// pragma mark -

const BEncodingRun		ISO8_0080(0x0080, 0x00A0, 0x0080);

const uint16	ISO8Block_00A2[] = {
0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x203E
};
const BEncodingRun		ISO8_00A2(0x00A2, 0x00BE, 0x00A2);
const BEncodingRun		ISO8_00E0(0x00E0, 0x00FA, 0x05D0);

const BEncodingRun * const ISO8Stack[] = {
&ISO8_0080, &ISO8_00A2, &ISO8_00E0
};
const uint16 ISO8StackSize = 3;

const BReplacement	ISO8Replace_00AA(0x00AA, 0x00D7);
const BReplacement	ISO8Replace_00AF(0x00AF, 0x023E);
const BReplacement	ISO8Replace_00BA(0x00BA, 0x00F7);
const BReplacement	ISO8Replace_00DF(0x00DF, 0x2017);
const BReplacement * const ISO8Replacements[] = {
&ISO8Replace_00AA, &ISO8Replace_00AF, &ISO8Replace_00BA, &ISO8Replace_00DF
};
const uint16 ISO8ReplacementCount = 4;

// pragma mark -

const BEncodingRun		ISO9_0080(0x0080, 0x00FF, 0x0080);

const BEncodingRun * const ISO9Stack[] = {
&ISO9_0080
};
const uint16 ISO9StackSize = 1;


const BReplacement	ISO9Replace_00D0(0x00D0, 0x011E);
const BReplacement	ISO9Replace_00DD(0x00DD, 0x0130);
const BReplacement	ISO9Replace_00DE(0x00DE, 0x015E);
const BReplacement	ISO9Replace_00F0(0x00F0, 0x011F);
const BReplacement	ISO9Replace_00FD(0x00FD, 0x0131);
const BReplacement	ISO9Replace_00FE(0x00FE, 0x015F);

const BReplacement * const ISO9Replacements[] = {
&ISO9Replace_00D0, &ISO9Replace_00DD, &ISO9Replace_00DE, &ISO9Replace_00F0, &ISO9Replace_00FD, &ISO9Replace_00FE
};
const uint16 ISO9ReplacementCount = 6;

// pragma mark -

const uint16	CP1253Block_0080[] = {
0x20AC, 0xFFFF, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021
};
const BEncodingRun		CP1253_0080(0x0080, 0x0087, CP1253Block_0080);


const uint16	CP1253Block_0091[] = {
0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014
};
const BEncodingRun		CP1253_0091(0x0091, 0x0097, CP1253Block_0091);


const uint16	CP1253Block_00A0[] = {
0x00A0, 0x0385, 0x0386, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0xFFFF, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7, 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD
};
const BEncodingRun		CP1253_00A0(0x00A0, 0x00BD, CP1253Block_00A0);

const BEncodingRun		CP1253_00BE(0x00BE, 0x00FE, 0x038E);

const BEncodingRun * const CP1253Stack[] = {
&CP1253_0080, &CP1253_0091, &CP1253_00A0, &CP1253_00BE
};
const uint16 CP1253StackSize = 4;

const BReplacement	CP1253Replace_0089(0x0089, 0x2030);
const BReplacement	CP1253Replace_008B(0x008B, 0x2039);
const BReplacement	CP1253Replace_0099(0x0099, 0x2122);
const BReplacement	CP1253Replace_009B(0x009B, 0x203A);
const BReplacement	CP1253Replace_00D2(0x00D2, 0xFFFF);
const BReplacement * const CP1253Replacements[] = {
&CP1253Replace_0089, &CP1253Replace_008B, &CP1253Replace_0099, &CP1253Replace_009B,
&CP1253Replace_00D2
};
const uint16 CP1253ReplacementCount = 5;

// pragma mark -

const uint16	CP1254Block_0080[] = {
0x20AC, 0xFFFF, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0xFFFF, 0xFFFF, 0x0178
};
const BEncodingRun		CP1254_0080(0x0080, 0x009F, CP1254Block_0080);

const BEncodingRun		CP1254_00A0(0x00A0, 0x00DC, 0x00A0);

const uint16	CP1254Block_00DD[] = {
0x0130, 0x015E
};
const BEncodingRun		CP1254_00DD(0x00DD, 0x00DE, CP1254Block_00DD);

const BEncodingRun		CP1254_00DF(0x00DF, 0x00FC, 0x00DF);

const uint16	CP1254Block_00FD[] = {
0x0131, 0x015F, 0x00FF
};
const BEncodingRun		CP1254_00FD(0x00FD, 0x00FF, CP1254Block_00FD);


const BEncodingRun * const CP1254Stack[] = {
&CP1254_0080, &CP1254_00A0, &CP1254_00DD, &CP1254_00DF, &CP1254_00FD
};
const uint16 CP1254StackSize = 5;

const BReplacement	CP1254Replace_00D0(0x00D0, 0x011E);
const BReplacement	CP1254Replace_00F0(0x00F0, 0x011F);
const BReplacement * const CP1254Replacements[] = {
&CP1254Replace_00D0, &CP1254Replace_00F0
};
const uint16 CP1254ReplacementCount = 2;

// pragma mark -

const uint16	CP1255Block_0082[] = {
0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0xFFFF, 0x2039
};
const BEncodingRun		CP1255_0082(0x0082, 0x008B, CP1255Block_0082);


const uint16	CP1255Block_0091[] = {
0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122
};
const BEncodingRun		CP1255_0091(0x0091, 0x0099, CP1255Block_0091);


const BEncodingRun		CP1255_00A0(0x00A0, 0x00BF, 0x00A5);
const BEncodingRun		CP1255_00C0(0x00C0, 0x00D3, 0x05B0);
const BEncodingRun		CP1255_00D4(0x00D4, 0x00D8, 0x05F0);
const BEncodingRun		CP1255_00E0(0x00E0, 0x00FA, 0x05D0);

const BEncodingRun * const CP1255Stack[] = {
&CP1255_0082, &CP1255_0091, &CP1255_00A0, &CP1255_00C0, &CP1255_00D4, &CP1255_00E0,
};
const uint16 CP1255StackSize = 6;

const BReplacement	CP1255Replace_0080(0x0080, 0x20AC);
const BReplacement	CP1255Replace_009B(0x009B, 0x203A);
const BReplacement	CP1255Replace_00A4(0x00A4, 0x20AA);
const BReplacement	CP1255Replace_00AA(0x00AA, 0x00D7);
const BReplacement	CP1255Replace_00BA(0x00BA, 0x00F7);
const BReplacement	CP1255Replace_00CA(0x00CA, 0xFFFF);
const BReplacement	CP1255Replace_00FD(0x00FD, 0x200E);
const BReplacement	CP1255Replace_00FE(0x00FE, 0x200F);
const BReplacement * const CP1255Replacements[] = {
&CP1255Replace_0080, &CP1255Replace_009B, &CP1255Replace_00A4, &CP1255Replace_00AA, &CP1255Replace_00BA, &CP1255Replace_00CA,  &CP1255Replace_00FD,  &CP1255Replace_00FE,
};
const uint16 CP1255ReplacementCount = 8;

// pragma mark -
const uint16	CP1256Block_0080[] = {
0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688,
0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA,
0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x06BE
};
const BEncodingRun		CP1256_0080(0x0080, 0x00AA, CP1256Block_0080);

const BEncodingRun		CP1256_00AB(0x00AB, 0x00B9, 0x00AB);

const uint16	CP1256Block_00BA[] = {
0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F, 0x06C1
};
const BEncodingRun		CP1256_00BA(0x00BA, 0x00C0, CP1256Block_00BA);

const BEncodingRun		CP1256_00C1(0x00C1, 0x00D6, 0x0621);

const uint16	CP1256Block_00D7[] = {
0x00D7, 0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0641, 0x0642, 0x0643, 0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648,
0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF, 0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650,
0x00F7, 0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2
};
const BEncodingRun		CP1256_00D7(0x00D7, 0x00FF, CP1256Block_00D7);


const BEncodingRun * const CP1256Stack[] = {
&CP1256_0080, &CP1256_00AB, &CP1256_00BA, &CP1256_00C1, &CP1256_00D7
};
const uint16 CP1256StackSize = 5;

// pragma mark -

const BEncodingRun		CP737_0080(0x0080, 0x0090, 0x0391);

const uint16	CP737Block_0091[] = {
0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9
};
const BEncodingRun		CP737_0091(0x0091, 0x0097, CP737Block_0091);

const BEncodingRun		CP737_0098(0x0098, 0x00A8, 0x03B1);

const uint16	CP737Block_00A9[] = {
0x03C3, 0x03C2, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555,
0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A,
0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A,
0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, 0x03C9, 0x03AC, 0x03AD, 0x03AE, 0x03CA, 0x03AF, 0x03CC, 0x03CD, 0x03CB,
0x03CE, 0x0386, 0x0388, 0x0389, 0x038A, 0x038C, 0x038E, 0x038F, 0x00B1, 0x2265, 0x2264, 0x03AA, 0x03AB, 0x00F7, 0x2248, 0x00B0,
0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0
};
const BEncodingRun		CP737_00A9(0x00A9, 0x00FF, CP737Block_00A9);


const BEncodingRun * const CP737Stack[] = {
&CP737_0080, &CP737_0091, &CP737_0098, &CP737_00A9
};
const uint16 CP737StackSize = 4;

// pragma mark -
const BEncodingRun		CP856_0080(0x0080, 0x009A, 0x05D0);

const uint16	CP856Block_00A9[] = {
0x00AE, 0x00AC, 0x00BD, 0x00BC
};
const BEncodingRun		CP856_00A9(0x00A9, 0x00AC, CP856Block_00A9);


const uint16	CP856Block_00AE[] = {
0x00AB, 0x00BB, 0x2591, 0x2592, 0x2593, 0x2502, 0x2524
};
const BEncodingRun		CP856_00AE(0x00AE, 0x00B4, CP856Block_00AE);


const uint16	CP856Block_00B8[] = {
0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, 0x00A5, 0x2510, 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C
};
const BEncodingRun		CP856_00B8(0x00B8, 0x00C5, CP856Block_00B8);


const uint16	CP856Block_00C8[] = {
0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4
};
const BEncodingRun		CP856_00C8(0x00C8, 0x00CF, CP856Block_00C8);


const uint16	CP856Block_00D9[] = {
0x2518, 0x250C, 0x2588, 0x2584, 0x00A6
};
const BEncodingRun		CP856_00D9(0x00D9, 0x00DD, CP856Block_00D9);


const uint16	CP856Block_00EE[] = {
0x00AF, 0x00B4, 0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8, 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2,
0x25A0, 0x00A0
};
const BEncodingRun		CP856_00EE(0x00EE, 0x00FF, CP856Block_00EE);


const BEncodingRun * const CP856Stack[] = {
&CP856_0080, &CP856_00A9, &CP856_00AE, &CP856_00B8, &CP856_00C8, &CP856_00D9, &CP856_00EE
};
const uint16 CP856StackSize = 7;

const BReplacement	CP856Replace_009C(0x009C, 0x00A3);
const BReplacement	CP856Replace_009E(0x009E, 0x00D7);
const BReplacement	CP856Replace_00DF(0x00DF, 0x2580);
const BReplacement	CP856Replace_00E6(0x00E6, 0x00B5);
const BReplacement * const CP856Replacements[] = {
&CP856Replace_009C,
&CP856Replace_009E, &CP856Replace_00DF, &CP856Replace_00E6
};
const uint16 CP856ReplacementCount = 4;

// pragma mark -
const uint16	CP857Block_0080[] = {
0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0131, 0x00C4, 0x00C5,
0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x0130, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x015E, 0x015F,
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x011E, 0x011F, 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0, 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, 0x00A5, 0x2510,
0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4,
0x00BA, 0x00AA, 0x00CA, 0x00CB, 0x00C8, 0xFFFF, 0x00CD, 0x00CE, 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00A6, 0x00CC, 0x2580,
0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0xFFFF, 0x00D7, 0x00DA, 0x00DB, 0x00D9, 0x00EC, 0x00FF, 0x00AF, 0x00B4,
0x00AD, 0x00B1, 0xFFFF, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8, 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0
};
const BEncodingRun		CP857_0080(0x0080, 0x00FF, CP857Block_0080);


const BEncodingRun * const CP857Stack[] = {
&CP857_0080
};
const uint16 CP857StackSize = 1;

// pragma mark -
const BEncodingRun		CP862_0080(0x0080, 0x009A, 0x05D0);

const uint16	CP862Block_009B[] = {
0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192, 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC,
0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551,
0x2557, 0x255D, 0x255C, 0x255B, 0x2510, 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569,
0x2566, 0x2560, 0x2550, 0x256C, 0x2567, 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C,
0x2588, 0x2584, 0x258C, 0x2590, 0x2580, 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, 0x03A6, 0x0398, 0x03A9,
0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229, 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, 0x00B0, 0x2219, 0x00B7,
0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0
};
const BEncodingRun		CP862_009B(0x009B, 0x00FF, CP862Block_009B);


const BEncodingRun * const CP862Stack[] = {
&CP862_0080, &CP862_009B
};
const uint16 CP862StackSize = 2;

// pragma mark -

const uint16	CP864Block_0080[] = {
0x00B0, 0x00B7, 0x2219, 0x221A, 0x2592, 0x2500, 0x2502, 0x253C, 0x2524, 0x252C, 0x251C, 0x2534, 0x2510, 0x250C, 0x2514, 0x2518,
0x03B2, 0x221E, 0x03C6, 0x00B1, 0x00BD, 0x00BC, 0x2248, 0x00AB, 0x00BB, 0xFEF7, 0xFEF8, 0xFFFF, 0xFFFF, 0xFEFB, 0xFEFC, 0xFFFF,
0x00A0, 0x00AD, 0xFE82, 0x00A3, 0x00A4, 0xFE84, 0xFFFF, 0xFFFF, 0xFE8E, 0xFE8F, 0xFE95, 0xFE99, 0x060C, 0xFE9D, 0xFEA1, 0xFEA5
};
const BEncodingRun		CP864_0080(0x0080, 0x00AF, CP864Block_0080);

const BEncodingRun		CP864_00B0(0x00B0, 0x00B9, 0x0660);

const uint16	CP864Block_00BA[] = {
0xFED1, 0x061B, 0xFEB1, 0xFEB5, 0xFEB9, 0x061F, 0x00A2, 0xFE80, 0xFE81, 0xFE83, 0xFE85, 0xFECA, 0xFE8B, 0xFE8D, 0xFE91, 0xFE93,
0xFE97, 0xFE9B, 0xFE9F, 0xFEA3, 0xFEA7, 0xFEA9, 0xFEAB, 0xFEAD, 0xFEAF, 0xFEB3, 0xFEB7, 0xFEBB, 0xFEBF, 0xFEC1, 0xFEC5, 0xFECB,
0xFECF, 0x00A6, 0x00AC, 0x00F7, 0x00D7, 0xFEC9, 0x0640, 0xFED3, 0xFED7, 0xFEDB, 0xFEDF, 0xFEE3, 0xFEE7, 0xFEEB, 0xFEED, 0xFEEF,
0xFEF3, 0xFEBD, 0xFECC, 0xFECE, 0xFECD, 0xFEE1, 0xFE7D, 0x0651, 0xFEE5, 0xFEE9, 0xFEEC, 0xFEF0, 0xFEF2, 0xFED0, 0xFED5, 0xFEF5,
0xFEF6, 0xFEDD, 0xFED9, 0xFEF1, 0x25A0
};
const BEncodingRun		CP864_00BA(0x00BA, 0x00FE, CP864Block_00BA);


const BEncodingRun * const CP864Stack[] = {
&CP864_0080, &CP864_00B0, &CP864_00BA
};
const uint16 CP864StackSize = 3;

const BReplacement	CP864Replace_0025(0x0025, 0x066A);
const BReplacement * const CP864Replacements[] = {
&CP864Replace_0025
};
const uint16 CP864ReplacementCount = 1;

// pragma mark -

const uint16	CP869Block_0086[] = {
0x0386, 0xFFFF, 0x00B7, 0x00AC, 0x00A6, 0x2018, 0x2019, 0x0388, 0x2015, 0x0389, 0x038A, 0x03AA, 0x038C, 0xFFFF, 0xFFFF, 0x038E,
0x03AB, 0x00A9, 0x038F, 0x00B2, 0x00B3, 0x03AC, 0x00A3, 0x03AD, 0x03AE, 0x03AF, 0x03CA, 0x0390, 0x03CC, 0x03CD, 0x0391, 0x0392,
0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x00BD, 0x0398, 0x0399, 0x00AB, 0x00BB, 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x039A,
0x039B, 0x039C, 0x039D, 0x2563, 0x2551, 0x2557, 0x255D, 0x039E, 0x039F, 0x2510, 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C,
0x03A0, 0x03A1, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9,
0x03B1, 0x03B2, 0x03B3, 0x2518, 0x250C, 0x2588, 0x2584, 0x03B4, 0x03B5, 0x2580
};
const BEncodingRun		CP869_0086(0x0086, 0x00DF, CP869Block_0086);

const BEncodingRun		CP869_00E0(0x00E0, 0x00EB, 0x03B6);

const uint16	CP869Block_00EC[] = {
0x03C3, 0x03C2, 0x03C4, 0x0384, 0x00AD, 0x00B1, 0x03C5, 0x03C6, 0x03C7, 0x00A7, 0x03C8, 0x0385, 0x00B0, 0x00A8, 0x03C9, 0x03CB,
0x03B0, 0x03CE, 0x25A0, 0x00A0
};
const BEncodingRun		CP869_00EC(0x00EC, 0x00FF, CP869Block_00EC);


const BEncodingRun * const CP869Stack[] = {
&CP869_0086, &CP869_00E0, &CP869_00EC
};
const uint16 CP869StackSize = 3;

// pragma mark -

const uint16	MacGreekBlock_0080[] = {
0x00C4, 0x00B9, 0x00B2, 0x00C9, 0x00B3, 0x00D6, 0x00DC, 0x0385, 0x00E0, 0x00E2, 0x00E4, 0x0384, 0x00A8, 0x00E7, 0x00E9, 0x00E8,
0x00EA, 0x00EB, 0x00A3, 0x2122, 0x00EE, 0x00EF, 0x2022, 0x00BD, 0x2030, 0x00F4, 0x00F6, 0x00A6, 0x00AD, 0x00F9, 0x00FB, 0x00FC,
0x2020, 0x0393, 0x0394, 0x0398, 0x039B, 0x039E, 0x03A0, 0x00DF, 0x00AE, 0x00A9, 0x03A3, 0x03AA, 0x00A7, 0x2260, 0x00B0, 0x00B7,
0x0391, 0x00B1, 0x2264, 0x2265, 0x00A5, 0x0392, 0x0395, 0x0396, 0x0397, 0x0399, 0x039A, 0x039C, 0x03A6, 0x03AB, 0x03A8, 0x03A9,
0x03AC, 0x039D, 0x00AC, 0x039F, 0x03A1, 0x2248, 0x03A4, 0x00AB, 0x00BB, 0x2026, 0x00A0, 0x03A5, 0x03A7, 0x0386, 0x0388, 0x0153,
0x2013, 0x2015, 0x201C, 0x201D, 0x2018, 0x2019, 0x00F7, 0x0389, 0x038A, 0x038C, 0x038E, 0x03AD, 0x03AE, 0x03AF, 0x03CC, 0x038F,
0x03CD, 0x03B1, 0x03B2, 0x03C8, 0x03B4, 0x03B5, 0x03C6, 0x03B3, 0x03B7, 0x03B9, 0x03BE, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BF,
0x03C0, 0x03CE, 0x03C1, 0x03C3, 0x03C4, 0x03B8, 0x03C9, 0x03C2, 0x03C7, 0x03C5, 0x03B6, 0x03CA, 0x03CB, 0x0390, 0x03B0, 0xF8A0
};
const BEncodingRun		MacGreek_0080(0x0080, 0x00FF, MacGreekBlock_0080);


const BEncodingRun * const MacGreekStack[] = {
&MacGreek_0080
};
const uint16 MacGreekStackSize = 1;

// pragma mark -
const uint16	MacHebrewBlock_0080[] = {
0x00C4, 0xFB1F, 0x00C7, 0x00C9, 0x00D1, 0x00D6, 0x00DC, 0x00E1, 0x00E0, 0x00E2, 0x00E4, 0x00E3, 0x00E5, 0x00E7, 0x00E9, 0x00E8,
0x00EA, 0x00EB, 0x00ED, 0x00EC, 0x00EE, 0x00EF, 0x00F1, 0x00F3, 0x00F2, 0x00F4, 0x00F6, 0x00F5, 0x00FA, 0x00F9, 0x00FB, 0x00FC,
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x20AA
};
const BEncodingRun		MacHebrew_0080(0x0080, 0x00A6, MacHebrewBlock_0080);

const BEncodingRun		MacHebrew_00A7(0x00A7, 0x00BF, 0x0027);

const uint16	MacHebrewBlock_00C1[] = {
0x201E, 0xF89B, 0xF89C, 0xF89D, 0xF89E, 0x05BC, 0xFB4B, 0xFB35, 0x2026, 0x00A0, 0x05B8, 0x05B7, 0x05B5, 0x05B6, 0x05B4, 0x2013,
0x2014, 0x201C, 0x201D, 0x2018, 0x2019, 0xFB2A, 0xFB2B, 0x05BF, 0x05B0, 0x05B2, 0x05B1, 0x05BB, 0x05B9
};
const BEncodingRun		MacHebrew_00C1(0x00C1, 0x00DD, MacHebrewBlock_00C1);

const BEncodingRun		MacHebrew_00E0(0x00E0, 0x00FA, 0x05D0);

const uint16	MacHebrewBlock_00FB[] = {
0x007D, 0x005D, 0x007B, 0x005B, 0x007C
};
const BEncodingRun		MacHebrew_00FB(0x00FB, 0x00FF, MacHebrewBlock_00FB);


const BEncodingRun * const MacHebrewStack[] = {
&MacHebrew_0080, &MacHebrew_00A7, &MacHebrew_00C1, &MacHebrew_00E0, &MacHebrew_00FB
};
const uint16 MacHebrewStackSize = 5;

const BReplacement	MacHebrewReplace_00DF(0x00DF, 0x05B3);
const BReplacement * const MacHebrewReplacements[] = {
&MacHebrewReplace_00DF
};
const uint16 MacHebrewReplacementCount = 1;

// pragma mark -
const uint16	MacTurkishBlock_0080[] = {
0x00C4, 0x00C5, 0x00C7, 0x00C9, 0x00D1, 0x00D6, 0x00DC, 0x00E1, 0x00E0, 0x00E2, 0x00E4, 0x00E3, 0x00E5, 0x00E7, 0x00E9, 0x00E8,
0x00EA, 0x00EB, 0x00ED, 0x00EC, 0x00EE, 0x00EF, 0x00F1, 0x00F3, 0x00F2, 0x00F4, 0x00F6, 0x00F5, 0x00FA, 0x00F9, 0x00FB, 0x00FC,
0x2020, 0x00B0, 0x00A2, 0x00A3, 0x00A7, 0x2022, 0x00B6, 0x00DF, 0x00AE, 0x00A9, 0x2122, 0x00B4, 0x00A8, 0x2260, 0x00C6, 0x00D8,
0x221E, 0x00B1, 0x2264, 0x2265, 0x00A5, 0x00B5, 0x2202, 0x2211, 0x220F, 0x03C0, 0x222B, 0x00AA, 0x00BA, 0x03A9, 0x00E6, 0x00F8,
0x00BF, 0x00A1, 0x00AC, 0x221A, 0x0192, 0x2248, 0x2206, 0x00AB, 0x00BB, 0x2026, 0x00A0, 0x00C0, 0x00C3, 0x00D5, 0x0152, 0x0153,
0x2013, 0x2014, 0x201C, 0x201D, 0x2018, 0x2019, 0x00F7, 0x25CA, 0x00FF, 0x0178, 0x011E, 0x011F, 0x0130, 0x0131, 0x015E, 0x015F,
0x2021, 0x00B7, 0x201A, 0x201E, 0x2030, 0x00C2, 0x00CA, 0x00C1, 0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF, 0x00CC, 0x00D3, 0x00D4,
0xF8FF, 0x00D2, 0x00DA, 0x00DB, 0x00D9, 0xF8A0, 0x02C6, 0x02DC, 0x00AF, 0x02D8, 0x02D9, 0x02DA, 0x00B8, 0x02DD, 0x02DB, 0x02C7
};
const BEncodingRun		MacTurkish_0080(0x0080, 0x00FF, MacTurkishBlock_0080);


const BEncodingRun * const MacTurkishStack[] = {
&MacTurkish_0080
};
const uint16 MacTurkishStackSize = 1;

// pragma mark -
BTextCodec * make_codec(const char * encoding, BTextEncodingAddOn *addOn) {
	if (strcasecmp(encoding, ISO6Name) == 0)
		return new	BTextCodec(ISO6Stack, ISO6StackSize, ISO6Replacements, ISO6ReplacementCount, addOn, USES_ASCII);
	
	else if (strcasecmp(encoding, ISO7Name) == 0)
		return new BTextCodec(ISO7Stack, ISO7StackSize, ISO7Replacements, ISO7ReplaceCount, addOn, USES_ASCII);
	
	else if (strcasecmp(encoding, ISO8Name) == 0)
		return new BTextCodec(ISO8Stack, ISO8StackSize, ISO8Replacements, ISO8ReplacementCount, addOn, USES_ASCII);

	else if (strcasecmp(encoding, ISO9Name) == 0)
		return new BTextCodec(ISO9Stack, ISO9StackSize, ISO9Replacements, ISO9ReplacementCount, addOn, USES_ASCII);

	else if (strcasecmp(encoding,CP1253Name) == 0)
		return new BTextCodec(CP1253Stack, CP1253StackSize, CP1253Replacements, CP1253ReplacementCount, addOn, USES_ASCII);

	else if (strcasecmp(encoding,CP1254Name) == 0)
		return new BTextCodec(CP1254Stack, CP1254StackSize, CP1254Replacements, CP1254ReplacementCount, addOn, USES_ASCII);

	else if (strcasecmp(encoding,CP1256Name) == 0)
		return new BTextCodec(CP1256Stack, CP1256StackSize, NULL, 0, addOn, USES_ASCII);


	else if (strcasecmp(encoding,CP1255Name) == 0)
		return new BTextCodec(CP1255Stack, CP1255StackSize, CP1255Replacements, CP1255ReplacementCount, addOn, USES_ASCII);

	else if (strcasecmp(encoding,CP737Name) == 0)
		return new BTextCodec(CP737Stack, CP737StackSize, NULL, 0, addOn, USES_ASCII);

	else if (strcasecmp(encoding,CP856Name) == 0)
		return new BTextCodec(CP856Stack, CP856StackSize, CP856Replacements, CP856ReplacementCount, addOn, USES_ASCII);

	else if (strcasecmp(encoding,CP857Name) == 0)
		return new BTextCodec(CP857Stack, CP857StackSize, NULL, 0, addOn, USES_ASCII);

	else if (strcasecmp(encoding,CP862Name) == 0)
		return new BTextCodec(CP862Stack, CP862StackSize, NULL, 0, addOn, USES_ASCII);

	else if (strcasecmp(encoding,CP864Name) == 0)
		return new BTextCodec(CP864Stack, CP864StackSize, CP864Replacements, CP864ReplacementCount, addOn, USES_ASCII);

	else if (strcasecmp(encoding,CP869Name) == 0)
		return new BTextCodec(CP869Stack, CP869StackSize, NULL, 0, addOn, USES_ASCII);

	else if (strcasecmp(encoding,MacGreekName) == 0)
		return new BTextCodec(MacGreekStack, MacGreekStackSize, NULL, 0, addOn, USES_ASCII);

	else if (strcasecmp(encoding,MacHebrewName) == 0)
		return new BTextCodec(MacHebrewStack, MacHebrewStackSize, MacHebrewReplacements, MacHebrewReplacementCount, addOn, USES_ASCII);

	else if (strcasecmp(encoding,MacTurkishName) == 0)
		return new BTextCodec(MacTurkishStack, MacTurkishStackSize, NULL, 0, addOn, USES_ASCII);
	else
		return NULL;
}

