Split "Text encoding" op into two ops

This commit splits "Text encoding" into two operations:
+ Encode text `string -> byteArray`
+ Decode text `byteArray -> string`

Base64 and Hex support are removed "Encode text" and "Decode text" as
they have their own operations.

Encode and decode operations now have support for the following
encodings:
+ IBM EBCDIC US-Canada
+ IBM EBCDIC International
+ Windows-874 Thai
+ Japanese Shift-JIS
+ Simplified Chinese GBK
+ Korean
+ Traditional Chinese Big5
+ UTF-16, little endian
+ UTF-16, big endian
+ Windows-1250 Central European
+ Windows-1251 Cyrillic
+ Windows-1252 Latin
+ Windows-1253 Greek
+ Windows-1254 Turkish
+ Windows-1255 Hebrew
+ Windows-1256 Arabic
+ Windows-1257 Baltic
+ Windows-1258 Vietnam
+ US-ASCII
+ Russian Cyrillic KOI8-R
+ Simplified Chinese GB2312
+ KOI8-U Ukrainian Cyrillic
+ ISO-8859-1 Latin 1 (Western European)
+ ISO-8859-2 Latin 2 (Central European)
+ ISO-8859-3 Latin 3
+ ISO-8859-4 Baltic
+ ISO-8859-5 Cyrillic
+ ISO-8859-6 Arabic
+ ISO-8859-7 Greek
+ ISO-8859-8 Hebrew
+ ISO-8859-9 Turkish
+ ISO-8859-10 Latin 6
+ ISO-8859-11 Latin (Thai)
+ ISO-8859-13 Latin 7 (Estonian)
+ ISO-8859-14 Latin 8 (Celtic)
+ ISO-8859-15 Latin 9
+ ISO-8859-16 Latin 10
+ ISO-2022 JIS Japanese
+ EUC Japanese
+ EUC Korean
+ Simplified Chinese GB18030
+ UTF-7
+ UTF-8
This commit is contained in:
toby 2017-05-17 11:17:11 -04:00
parent 3c15bd9e29
commit 2b7ba594fc
5 changed files with 2119 additions and 121 deletions

View file

@ -9,42 +9,42 @@ import TestRegister from "../../TestRegister.js";
TestRegister.addTests([
{
name: "From EBCDIC: nothing",
name: "Encode text, Decode text: nothing",
input: "",
expectedOutput: "",
recipeConfig: [
{
"op": "From Hex",
"args": ["Space"]
"op": "Encode text",
"args": ["UTF-8"]
},
{
"op": "From EBCDIC",
"args": ["IBM EBCDIC International"]
"op": "Decode text",
"args": ["UTF-8"]
},
],
},
{
name: "From EBCDIC: hello",
input: "88 85 93 93 96",
name: "Encode text, Decode text: hello",
input: "hello",
expectedOutput: "hello",
recipeConfig: [
{
"op": "From Hex",
"args": ["Space"]
"op": "Encode text",
"args": ["UTF-8"]
},
{
"op": "From EBCDIC",
"args": ["IBM EBCDIC International"]
"op": "Decode text",
"args": ["UTF-8"]
},
],
},
{
name: "To EBCDIC: hello",
name: "Encode text (EBCDIC): hello",
input: "hello",
expectedOutput: "88 85 93 93 96",
recipeConfig: [
{
"op": "To EBCDIC",
"op": "Encode text",
"args": ["IBM EBCDIC International"]
},
{
@ -53,4 +53,19 @@ TestRegister.addTests([
},
],
},
{
name: "Decode text (EBCDIC): 88 85 93 93 96",
input: "88 85 93 93 96",
expectedOutput: "hello",
recipeConfig: [
{
"op": "From Hex",
"args": ["Space"]
},
{
"op": "Decode text",
"args": ["IBM EBCDIC International"]
},
],
},
]);