Skip to content

Commit

Permalink
Go with non-MIME names as not all encodings have such.
Browse files Browse the repository at this point in the history
  • Loading branch information
HaxyM authored Sep 26, 2024
1 parent f0921a2 commit 57cc0a0
Showing 1 changed file with 42 additions and 6 deletions.
48 changes: 42 additions & 6 deletions include/crap/text_encoding.d/textencodingtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ namespace crap
struct textEncodingType<text_encoding_id_ISOLatin1_t> : textEncodingType<void>
{
using mib = text_encoding_id_ISOLatin1_t;
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '1'>; //Libstdc++ uses name ISO-8859-1:1987
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '1', ':', '1', '9', '8', '7'>;
using aliases = typeList<
string<char 'i', 's', 'o', '-', 'i', 'r', '-', '1', '0', '0'>,
string<char, 'I', 'S', 'O', '_', '8', '8', '5', '9', '-', '1'>,
Expand All @@ -356,7 +356,7 @@ namespace crap
struct textEncodingType<text_encoding_id_ISOLatin2_t> : textEncodingType<void>
{
using mib = text_encoding_id_ISOLatin2_t;
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '2'>; //Libstdc++ uses name ISO-8859-2:1987
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '2', ':', '1', '9', '8', '7'>;
using aliases = typeList<
string<char 'i', 's', 'o', '-', 'i', 'r', '-', '1', '0', '1'>,
string<char, 'I', 'S', 'O', '_', '8', '8', '5', '9', '-', '2'>,
Expand All @@ -370,7 +370,7 @@ namespace crap
struct textEncodingType<text_encoding_id_ISOLatin3_t> : textEncodingType<void>
{
using mib = text_encoding_id_ISOLatin3_t;
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '3'>; //Libstdc++ uses name ISO-8859-3:1987
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '3', ':', '1', '9', '8', '8'>;
using aliases = typeList<
string<char 'i', 's', 'o', '-', 'i', 'r', '-', '1', '0', '9'>,
string<char, 'I', 'S', 'O', '_', '8', '8', '5', '9', '-', '3'>,
Expand All @@ -384,7 +384,7 @@ namespace crap
struct textEncodingType<text_encoding_id_ISOLatin4_t> : textEncodingType<void>
{
using mib = text_encoding_id_ISOLatin4_t;
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '4'>; //Libstdc++ uses name ISO-8859-4:1987
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '4', ':', '1', '9', '8', '8'>;
using aliases = typeList<
string<char 'i', 's', 'o', '-', 'i', 'r', '-', '1', '1', '0'>,
string<char, 'I', 'S', 'O', '_', '8', '8', '5', '9', '-', '4'>,
Expand All @@ -398,7 +398,7 @@ namespace crap
struct textEncodingType<text_encoding_id_ISOLatinCyrillic_t> : textEncodingType<void>
{
using mib = text_encoding_id_ISOLatinCyrillic_t;
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '5'>; //Libstdc++ uses name ISO-8859-5:1987
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '5', ':', '1', '9', '8', '8'>;
using aliases = typeList<
string<char 'i', 's', 'o', '-', 'i', 'r', '-', '1', '4', '4'>,
string<char, 'I', 'S', 'O', '_', '8', '8', '5', '9', '-', '5'>,
Expand All @@ -411,7 +411,7 @@ namespace crap
struct textEncodingType<text_encoding_id_ISOLatinArabic_t> : textEncodingType<void>
{
using mib = text_encoding_id_ISOLatinArabic_t;
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '6'>; //Libstdc++ uses name ISO-8859-6:1987
using name = string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '6', ':', '1', '9', '8', '7'>;
using aliases = typeList<
string<char 'i', 's', 'o', '-', 'i', 'r', '-', '1', '2', '7'>,
string<char, 'I', 'S', 'O', '_', '8', '8', '5', '9', '-', '6'>,
Expand Down Expand Up @@ -578,36 +578,72 @@ namespace crap
{
};

template <>
struct textEncodingType<string<char 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '1', ':', '1', '9', '8', '7'> >
: textEncodingType<text_encoding_id_ISOLatin1_t>
{
};

template <>
struct textEncodingType<string<char 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '2'> >
: textEncodingType<text_encoding_id_ISOLatin2_t>
{
};

template <>
struct textEncodingType<string<char 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '2', ':', '1', '9', '8', '7'> >
: textEncodingType<text_encoding_id_ISOLatin2_t>
{
};

template <>
struct textEncodingType<string<char 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '3'> >
: textEncodingType<text_encoding_id_ISOLatin3_t>
{
};

template <>
struct textEncodingType<string<char 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '3', ':', '1', '9', '8', '8'> >
: textEncodingType<text_encoding_id_ISOLatin3_t>
{
};

template <>
struct textEncodingType<string<char 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '4'> >
: textEncodingType<text_encoding_id_ISOLatin4_t>
{
};

template <>
struct textEncodingType<string<char 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '4', ':', '1', '9', '8', '8'> >
: textEncodingType<text_encoding_id_ISOLatin4_t>
{
};

template <>
struct textEncodingType<string<char 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '5'> >
: textEncodingType<text_encoding_id_ISOLatinCyrillic_t>
{
};

template <>
struct textEncodingType<string<char 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '5', ':', '1', '9', '8', '8'> >
: textEncodingType<text_encoding_id_ISOLatinCyrillic_t>
{
};

template <>
struct textEncodingType<string<char 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '6'> >
: textEncodingType<text_encoding_id_ISOLatinArabic_t>
{
};

template <>
struct textEncodingType<string<char 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '6', ':', '1', '9', '8', '7'> >
: textEncodingType<text_encoding_id_ISOLatinArabic_t>
{
};

template <>
struct textEncodingType<string<char 'i', 's', 'o', '-', 'i', 'r', '-', '1', '0', '0'> >
: textEncodingType<text_encoding_id_ISOLatin1_t>
Expand Down

0 comments on commit 57cc0a0

Please sign in to comment.