Last active
August 29, 2015 13:57
-
-
Save hakanai/9562691 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User fills in a form like this: | |
Enter the data you want to process: | |
+-------------------------------------------------------------------------------------------+ | |
| Content-Type: image/png; | | |
| name*0*=ISO-2022-JP''%1B%24B%24%22%24%24%24%26%24%28%24*%24%22%24%24%24%26; | | |
| name*1*=%24%28%24*%24%22%24%24%24%26%24%28%24*%24%22%24%24%24%26%24%28; | | |
| name*2*=%24*%1B%28B.png | | |
+-------------------------------------------------------------------------------------------+ | |
What do you want to do: | |
[ Parse MIME headers ] | |
[ Submit ] | |
The output we want is something like this: | |
Content-Type: image/png; | |
name*0*=ISO-2022-JP''%1B%24B%24%22%24%24%24%26%24%28%24*%24%22%24%24%24%26; | |
name*1*=%24%28%24*%24%22%24%24%24%26%24%28%24*%24%22%24%24%24%26%24%28; | |
name*2*=%24*%1B%28B.png | |
|| | |
|| Parse header parts | |
\/ | |
Name: Content-Type | |
Value: image/png | |
Parameters: | |
name*0*: ISO-2022-JP''%1B%24B%24%22%24%24%24%26%24%28%24*%24%22%24%24%24%26 | |
name*1*: %24%28%24*%24%22%24%24%24%26%24%28%24*%24%22%24%24%24%26%24%28 | |
name*2*: %24*%1B%28B.png | |
|| | |
|| Recombine RFC 2231 parameters: | |
\/ | |
Name: Content-Type | |
Value: image/png | |
Parameters: | |
name: ISO-2022-JP''%1B%24B%24%22%24%24%24%26%24%28%24*%24%22%24%24%24%26%24%28%24*%24%22%24%24%24%26%24%28%24*%24%22%24%24%24%26%24%28%24*%1B%28B.png | |
|| | |
|| Interpret RFC 2231 string: | |
\/ | |
Name: Content-Type | |
Value: image/png | |
Parameters: | |
name: | |
encoding: ISO-2022-JP | |
language: (empty) | |
content: [ESC-]$B $"$$$&$($*$"$$$&$($*$"$$$&$($*$"$$$&$($* [ESC](B.png | |
|| | |
|| Decode RFC 2231 string: | |
\/ | |
Name: Content-Type | |
Value: image/png | |
Parameters: | |
name: | |
encoding: ISO-2022-JP | |
language: (empty) | |
content: [ESC-]$B $"$$$&$($*$"$$$&$($*$"$$$&$($*$"$$$&$($* [ESC](B.png | |
value: あいうえおあいうえおあいうえおあいうえお.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment