1<!DOCTYPE html> 2<meta charset="utf-8"> 3<meta name=timeout content=long> 4<title>Upload files in ISO-2022-JP form (tentative)</title> 5<!-- 6 NOTE: This test is tentative because encoding for filename 7 characters unrepresentable in the form charset is not yet 8 standardized. 9 --> 10<link rel="help" 11 href="https://github.com/whatwg/html/issues/3223"> 12<link rel="help" 13 href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-data"> 14<link rel="help" 15 href="https://html.spec.whatwg.org/multipage/dnd.html#datatransferitemlist"> 16<link rel="help" 17 href="https://w3c.github.io/FileAPI/#file-constructor"> 18<link rel="author" title="Benjamin C. Wiley Sittler" 19 href="mailto:bsittler@chromium.org"> 20<script src="/resources/testharness.js"></script> 21<script src="/resources/testharnessreport.js"></script> 22<script src="../support/send-file-form-helper.js"></script> 23<script> 24'use strict'; 25 26formPostFileUploadTest({ 27 fileNameSource: 'ASCII', 28 fileBaseName: 'file-for-upload-in-form.txt', 29 formEncoding: 'ISO-2022-JP', 30 expectedEncodedBaseName: 'file-for-upload-in-form.txt', 31}); 32 33formPostFileUploadTest({ 34 fileNameSource: 'x-user-defined', 35 fileBaseName: 'file-for-upload-in-form-\uF7F0\uF793\uF783\uF7A0.txt', 36 formEncoding: 'ISO-2022-JP', 37 expectedEncodedBaseName: ( 38 'file-for-upload-in-form-.txt'), 39}); 40 41formPostFileUploadTest({ 42 fileNameSource: 'windows-1252', 43 fileBaseName: 'file-for-upload-in-form-☺😂.txt', 44 formEncoding: 'ISO-2022-JP', 45 expectedEncodedBaseName: ( 46 'file-for-upload-in-form-☺😂.txt'), 47}); 48 49formPostFileUploadTest({ 50 fileNameSource: 'JIS X 0201 and JIS X 0208', 51 fileBaseName: 'file-for-upload-in-form-★星★.txt', 52 formEncoding: 'ISO-2022-JP', 53 expectedEncodedBaseName: 'file-for-upload-in-form-\x1B$B!z@1!z\x1B(B.txt', 54}); 55 56formPostFileUploadTest({ 57 fileNameSource: 'Unicode', 58 fileBaseName: 'file-for-upload-in-form-☺.txt', 59 formEncoding: 'ISO-2022-JP', 60 expectedEncodedBaseName: 'file-for-upload-in-form-☺😂.txt', 61}); 62 63formPostFileUploadTest({ 64 fileNameSource: 'Unicode', 65 fileBaseName: `file-for-upload-in-form-${kTestChars}.txt`, 66 formEncoding: 'ISO-2022-JP', 67 expectedEncodedBaseName: `file-for-upload-in-form-${ 68 kTestFallbackIso2022jp 69 }.txt`, 70}); 71 72</script> 73