Skip to content

Commit

Permalink
Add Latin4 text encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
HaxyM authored Sep 25, 2024
1 parent a7e68a7 commit 97143a1
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions include/crap/text_encoding.d/textencodingtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ namespace crap
using text_encoding_id_ISOLatin3_t =
std :: integral_constant<textEncodingType <void> :: id, textEncodingType <void> :: id :: ISOLatin3>;

using text_encoding_id_ISOLatin4_t =
std :: integral_constant<textEncodingType <void> :: id, textEncodingType <void> :: id :: ISOLatin4>;

template <>
struct textEncodingType<text_encoding_id_ASCII_t> : textEncodingType<void>
{
Expand Down Expand Up @@ -371,6 +374,20 @@ namespace crap
string<char 'c', 's', 'I', 'S', 'O', 'L', 'a', 't', 'i', 'n', '3'> >;
};

template <>
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 aliases = typeList<
string<char 'i', 's', 'o', '-', 'i', 'r', '-', '1', '1', '0'>,
string<char, 'I', 'S', 'O', '_', '8', '8', '5', '9', '-', '4'>,
string<char, 'I', 'S', 'O', '-', '8', '8', '5', '9', '-', '4'>,
string<char, 'l', 'a', 't', 'i', 'n', '4'>,
string<char, 'l', '4'>,
string<char 'c', 's', 'I', 'S', 'O', 'L', 'a', 't', 'i', 'n', '4'> >;
};

template <>
struct textEncodingType<string<char 'A', 'N', 'S', 'I', '_', 'X', '3', '.', '4', '-', '1', '9', '6', '8'> >
: textEncodingType<text_encoding_id_ASCII_t>
Expand Down Expand Up @@ -419,6 +436,12 @@ namespace crap
{
};

template <>
struct textEncodingType<string<char 'c', 's', 'I', 'S', 'O', 'L', 'a', 't', 'i', 'n', '4'> >
: textEncodingType<text_encoding_id_ISOLatin4_t>
{
};

template <>
struct textEncodingType<string<char 'I', 'B', 'M', '3', '6', '7'> >
: textEncodingType<text_encoding_id_ASCII_t>
Expand Down Expand Up @@ -461,6 +484,12 @@ namespace crap
{
};

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', '-', '1'> >
: textEncodingType<text_encoding_id_ISOLatin1_t>
Expand All @@ -479,6 +508,12 @@ namespace crap
{
};

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', '-', 'i', 'r', '-', '1', '0', '0'> >
: textEncodingType<text_encoding_id_ISOLatin1_t>
Expand All @@ -497,6 +532,12 @@ namespace crap
{
};

template <>
struct textEncodingType<string<char 'i', 's', 'o', '-', 'i', 'r', '-', '1', '1', '0'> >
: textEncodingType<text_encoding_id_ISOLatin4_t>
{
};

template <>
struct textEncodingType<string<char 'i', 's', 'o', '-', 'i', 'r', '-', '6'> >
: textEncodingType<text_encoding_id_ASCII_t>
Expand All @@ -521,6 +562,12 @@ namespace crap
{
};

template <>
struct textEncodingType<string<char 'l', '4'> >
: textEncodingType<text_encoding_id_ISOLatin4_t>
{
};

template <>
struct textEncodingType<string<char 'l', 'a', 't', 'i', 'n', '1'> >
: textEncodingType<text_encoding_id_ISOLatin1_t>
Expand All @@ -539,6 +586,12 @@ namespace crap
{
};

template <>
struct textEncodingType<string<char 'l', 'a', 't', 'i', 'n', '4'> >
: textEncodingType<text_encoding_id_ISOLatin4_t>
{
};

template <>
struct textEncodingType<string<char 'u', 's'> >
: textEncodingType<text_encoding_id_ASCII_t>
Expand Down

0 comments on commit 97143a1

Please sign in to comment.