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