diff --git a/test/content-type.test.js b/test/content-type.test.js index 2bef08ec..b963c6ae 100644 --- a/test/content-type.test.js +++ b/test/content-type.test.js @@ -50,3 +50,27 @@ test('content type binary', (t) => { t.equal(headers['content-type'], 'application/wasm'); }); }); + +test('charset arabic', (t) => { + t.plan(3); + + const server = http.createServer( + ecstatic({root}) + ); + + checkHeaders(t, server, 'charset/arabic.html', (t, headers) => { + t.equal(headers['content-type'], 'text/html; charset=ISO-8859-6'); + }); +}); + +test('charset Shift_JIS', (t) => { + t.plan(3); + + const server = http.createServer( + ecstatic({root}) + ); + + checkHeaders(t, server, 'charset/shift_jis.html', (t, headers) => { + t.equal(headers['content-type'], 'text/html; charset=Shift_JIS'); + }); +}); diff --git a/test/public/charset/arabic.html b/test/public/charset/arabic.html new file mode 100644 index 00000000..35b8b78d --- /dev/null +++ b/test/public/charset/arabic.html @@ -0,0 +1,21 @@ + + + + + + HTML + + + +

Kokoro - Natsume Soseki

+

+

+

+ . + . . + + "". . + . +

+ + diff --git a/test/public/charset/shift_jis.html b/test/public/charset/shift_jis.html new file mode 100644 index 00000000..bfa4773d --- /dev/null +++ b/test/public/charset/shift_jis.html @@ -0,0 +1,17 @@ + + + + + + {HTMLt@C + + + +

- Ėڟ

+

@搶Ǝ

+

+

+ ͂̐lɐ搶ƌĂłB炱ł搶ƏŖ{͑łȂB͐Ԃ݂鉓ƂA̕ɂƂĎRłB͂̐l̋LĂыNƂɁAu搶vƂȂBMĂS͓łB悻悻Ȃǂ͂ƂĂgCɂȂȂB +

+ +