Skip to content

Commit

Permalink
Support USASCII encoding as UTF8
Browse files Browse the repository at this point in the history
Fixes mailhog/MailHog#282
USASCII is a subset of UTF8 so lets support it using the UTF8 methods which already exist.
  • Loading branch information
khag7 committed Aug 29, 2020
1 parent 24b31a4 commit 76dd289
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions assets/js/strutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -700,15 +700,17 @@ var OUTPUT_CONVERTERS = {
'ISO88591': convertUnicodeCodePointsToIso88591Bytes,
'SHIFTJIS': convertUnicodeCodePointsToSjisBytes,
'EUCJP': convertUnicodeCodePointsToEucJpBytes,
'UTF8': convertUnicodeCodePointsToUtf8Bytes
'UTF8': convertUnicodeCodePointsToUtf8Bytes,
'USASCII': convertUnicodeCodePointsToUtf8Bytes
}

var INPUT_CONVERTERS = {
'ISO2022JP': convertIso2022JpBytesToUnicodeCodePoints,
'ISO88591': convertIso88591BytesToUnicodeCodePoints,
'SHIFTJIS': convertSjisBytesToUnicodeCodePoints,
'EUCJP': convertEucJpBytesToUnicodeCodePoints,
'UTF8': convertUtf8BytesToUnicodeCodePoints
'UTF8': convertUtf8BytesToUnicodeCodePoints,
'USASCII': convertUtf8BytesToUnicodeCodePoints
}

function convertUnicodeCodePointsToBytes(unicode_codes, encoding) {
Expand Down

0 comments on commit 76dd289

Please sign in to comment.