• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html>
2<meta charset="utf-8">
3<meta name=timeout content=long>
4<title>Upload files in ISO-2022-JP form</title>
5<link rel="help"
6      href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-data">
7<link rel="help"
8      href="https://html.spec.whatwg.org/multipage/dnd.html#datatransferitemlist">
9<link rel="help"
10      href="https://w3c.github.io/FileAPI/#file-constructor">
11<link rel="author" title="Benjamin C. Wiley Sittler"
12      href="mailto:bsittler@chromium.org">
13<script src="/resources/testharness.js"></script>
14<script src="/resources/testharnessreport.js"></script>
15<script src="../support/send-file-form-helper.js"></script>
16<script>
17'use strict';
18
19formPostFileUploadTest({
20  fileNameSource: 'ASCII',
21  fileBaseName: 'file-for-upload-in-form.txt',
22  formEncoding: 'ISO-2022-JP',
23  expectedEncodedBaseName: 'file-for-upload-in-form.txt',
24});
25
26formPostFileUploadTest({
27  fileNameSource: 'x-user-defined',
28  fileBaseName: 'file-for-upload-in-form-\uF7F0\uF793\uF783\uF7A0.txt',
29  formEncoding: 'ISO-2022-JP',
30  expectedEncodedBaseName: (
31      'file-for-upload-in-form-&#63472;&#63379;&#63363;&#63392;.txt'),
32});
33
34formPostFileUploadTest({
35  fileNameSource: 'windows-1252',
36  fileBaseName: 'file-for-upload-in-form-☺😂.txt',
37  formEncoding: 'ISO-2022-JP',
38  expectedEncodedBaseName: (
39      'file-for-upload-in-form-&#226;&#732;&#186;&#240;&#376;&#732;&#8218;.txt'),
40});
41
42formPostFileUploadTest({
43  fileNameSource: 'JIS X 0201 and JIS X 0208',
44  fileBaseName: 'file-for-upload-in-form-★星★.txt',
45  formEncoding: 'ISO-2022-JP',
46  expectedEncodedBaseName: 'file-for-upload-in-form-\x1B$B!z@1!z\x1B(B.txt',
47});
48
49formPostFileUploadTest({
50  fileNameSource: 'Unicode',
51  fileBaseName: 'file-for-upload-in-form-☺��.txt',
52  formEncoding: 'ISO-2022-JP',
53  expectedEncodedBaseName: 'file-for-upload-in-form-&#9786;&#128514;.txt',
54});
55
56formPostFileUploadTest({
57  fileNameSource: 'Unicode',
58  fileBaseName: `file-for-upload-in-form-${kTestChars}.txt`,
59  formEncoding: 'ISO-2022-JP',
60  expectedEncodedBaseName: `file-for-upload-in-form-${
61      kTestFallbackIso2022jp
62  }.txt`,
63});
64
65</script>
66