文字コードが引き起こすセキュリティ上の問題として、
ご存じのとおり、
この
具体的な例として、
Windows上でのUnicodeからShift_JISへの変換
Windows上での文字列のUnicode
このWideChatToMultiByte関数は、
WC_
WC_
WC_
Unicode | Shift_ |
||
---|---|---|---|
¡ | U+00a1 | ! | 0x21 |
¢ | U+00a2 | ¢ | 0x81 0x91 |
£ | U+00a3 | £ | 0x81 0x92 |
¥ | U+00a5 | \ | 0x5C |
¦ | U+00a6 | | | 0x7C |
© | U+00a9 | c | 0x63 |
ª | U+00aa | a | 0x61 |
« | U+00ab | ≪ | 0x81 0xE1 |
¬ | U+00ac | ¬ | 0x81 0xCA |
(Soft Hyphen) | U+00ad | - | 0x2D |
® | U+00ae | R | 0x52 |
¯ | U+00af |  ̄ | 0x81 0x50 |
² | U+00b2 | 2 | 0x32 |
³ | U+00b3 | 3 | 0x33 |
µ | U+00b5 | μ | 0x83 0xCA |
· | U+00b7 | ・ | 0x81 0x45 |
¸ | U+00b8 | 、 | 0x81 0x43 |
¹ | U+00b9 | 1 | 0x31 |
º | U+00ba | o | 0x6F |
» | U+00bb | ≫ | 0x81 0xE2 |
À | U+00c0 | A | 0x41 |
Á | U+00c1 | A | 0x41 |
 | U+00c2 | A | 0x41 |
à | U+00c3 | A | 0x41 |
Ä | U+00c4 | A | 0x41 |
Å | U+00c5 | A | 0x41 |
Æ | U+00c6 | A | 0x41 |
Ç | U+00c7 | C | 0x43 |
È | U+00c8 | E | 0x45 |
É | U+00c9 | E | 0x45 |
Ê | U+00ca | E | 0x45 |
Ë | U+00cb | E | 0x45 |
Ì | U+00cc | I | 0x49 |
Í | U+00cd | I | 0x49 |
Î | U+00ce | I | 0x49 |
Ï | U+00cf | I | 0x49 |
Ð | U+00d0 | D | 0x44 |
Ñ | U+00d1 | N | 0x4E |
Ò | U+00d2 | O | 0x4F |
Ó | U+00d3 | O | 0x4F |
Ô | U+00d4 | O | 0x4F |
Õ | U+00d5 | O | 0x4F |
Ö | U+00d6 | O | 0x4F |
Ø | U+00d8 | O | 0x4F |
Ù | U+00d9 | U | 0x55 |
Ú | U+00da | U | 0x55 |
Û | U+00db | U | 0x55 |
Ü | U+00dc | U | 0x55 |
Ý | U+00dd | Y | 0x59 |
Þ | U+00de | T | 0x54 |
ß | U+00df | s | 0x73 |
à | U+00e0 | a | 0x61 |
á | U+00e1 | a | 0x61 |
â | U+00e2 | a | 0x61 |
ã | U+00e3 | a | 0x61 |
ä | U+00e4 | a | 0x61 |
å | U+00e5 | a | 0x61 |
æ | U+00e6 | a | 0x61 |
ç | U+00e7 | c | 0x63 |
è | U+00e8 | e | 0x65 |
é | U+00e9 | e | 0x65 |
ê | U+00ea | e | 0x65 |
ë | U+00eb | e | 0x65 |
ì | U+00ec | i | 0x69 |
í | U+00ed | i | 0x69 |
î | U+00ee | i | 0x69 |
ï | U+00ef | i | 0x69 |
ð | U+00f0 | d | 0x64 |
ñ | U+00f1 | n | 0x6E |
ò | U+00f2 | o | 0x6F |
ó | U+00f3 | o | 0x6F |
ô | U+00f4 | o | 0x6F |
õ | U+00f5 | o | 0x6F |
ö | U+00f6 | o | 0x6F |
ø | U+00f8 | o | 0x6F |
ù | U+00f9 | u | 0x75 |
ú | U+00fa | u | 0x75 |
û | U+00fb | u | 0x75 |
ü | U+00fc | u | 0x75 |
ý | U+00fd | y | 0x79 |
þ | U+00fe | t | 0x74 |
ÿ | U+00ff | y | 0x79 |
ゔ | U+3094 | ヴ | 0x83 0x94 |
この表を見るとわかるように、
このように、
Windows上でのUnicodeからISO-8859-1への変換
ISO-8859-1
Unicode | ISO-8859-1 | ||
---|---|---|---|
Ā | U+0100 | A | 0x41 |
ā | U+0101 | a | 0x61 |
Ă | U+0102 | A | 0x41 |
ă | U+0103 | a | 0x61 |
Ą | U+0104 | A | 0x41 |
ą | U+0105 | a | 0x61 |
Ć | U+0106 | C | 0x43 |
ć | U+0107 | c | 0x63 |
Ĉ | U+0108 | C | 0x43 |
ĉ | U+0109 | c | 0x63 |
Ċ | U+010a | C | 0x43 |
ċ | U+010b | c | 0x63 |
Č | U+010c | C | 0x43 |
č | U+010d | c | 0x63 |
Ď | U+010e | D | 0x44 |
ď | U+010f | d | 0x64 |
Đ | U+0110 | D | 0xD0 |
đ | U+0111 | d | 0x64 |
Ē | U+0112 | E | 0x45 |
ē | U+0113 | e | 0x65 |
Ĕ | U+0114 | E | 0x45 |
ĕ | U+0115 | e | 0x65 |
Ė | U+0116 | E | 0x45 |
ė | U+0117 | e | 0x65 |
Ę | U+0118 | E | 0x45 |
ę | U+0119 | e | 0x65 |
Ě | U+011a | E | 0x45 |
ě | U+011b | e | 0x65 |
Ĝ | U+011c | G | 0x47 |
ĝ | U+011d | g | 0x67 |
Ğ | U+011e | G | 0x47 |
ğ | U+011f | g | 0x67 |
Ġ | U+0120 | G | 0x47 |
ġ | U+0121 | g | 0x67 |
Ģ | U+0122 | G | 0x47 |
ģ | U+0123 | g | 0x67 |
Ĥ | U+0124 | H | 0x48 |
ĥ | U+0125 | h | 0x68 |
Ħ | U+0126 | H | 0x48 |
ħ | U+0127 | h | 0x68 |
Ĩ | U+0128 | I | 0x49 |
ĩ | U+0129 | i | 0x69 |
Ī | U+012a | I | 0x49 |
ī | U+012b | i | 0x69 |
Ĭ | U+012c | I | 0x49 |
ĭ | U+012d | i | 0x69 |
Į | U+012e | I | 0x49 |
į | U+012f | i | 0x69 |
İ | U+0130 | I | 0x49 |
ı | U+0131 | i | 0x69 |
Ĵ | U+0134 | J | 0x4A |
ĵ | U+0135 | j | 0x6A |
Ķ | U+0136 | K | 0x4B |
ķ | U+0137 | k | 0x6B |
Ĺ | U+0139 | L | 0x4C |
ĺ | U+013a | l | 0x6C |
Ļ | U+013b | L | 0x4C |
ļ | U+013c | l | 0x6C |
Ľ | U+013d | L | 0x4C |
ľ | U+013e | l | 0x6C |
Ł | U+0141 | L | 0x4C |
ł | U+0142 | l | 0x6C |
Ń | U+0143 | N | 0x4E |
ń | U+0144 | n | 0x6E |
Ņ | U+0145 | N | 0x4E |
ņ | U+0146 | n | 0x6E |
Ň | U+0147 | N | 0x4E |
ň | U+0148 | n | 0x6E |
Ō | U+014c | O | 0x4F |
ō | U+014d | o | 0x6F |
Ŏ | U+014e | O | 0x4F |
ŏ | U+014f | o | 0x6F |
Ő | U+0150 | O | 0x4F |
ő | U+0151 | o | 0x6F |
Ŕ | U+0154 | R | 0x52 |
ŕ | U+0155 | r | 0x72 |
Ŗ | U+0156 | R | 0x52 |
ŗ | U+0157 | r | 0x72 |
Ř | U+0158 | R | 0x52 |
ř | U+0159 | r | 0x72 |
Ś | U+015a | S | 0x53 |
ś | U+015b | s | 0x73 |
Ŝ | U+015c | S | 0x53 |
ŝ | U+015d | s | 0x73 |
Ş | U+015e | S | 0x53 |
ş | U+015f | s | 0x73 |
Ţ | U+0162 | T | 0x54 |
ţ | U+0163 | t | 0x74 |
Ť | U+0164 | T | 0x54 |
ť | U+0165 | t | 0x74 |
Ŧ | U+0166 | T | 0x54 |
ŧ | U+0167 | t | 0x74 |
Ũ | U+0168 | U | 0x55 |
ũ | U+0169 | u | 0x75 |
Ū | U+016a | U | 0x55 |
ū | U+016b | u | 0x75 |
Ŭ | U+016c | U | 0x55 |
ŭ | U+016d | u | 0x75 |
Ů | U+016e | U | 0x55 |
ů | U+016f | u | 0x75 |
Ű | U+0170 | U | 0x55 |
ű | U+0171 | u | 0x75 |
Ų | U+0172 | U | 0x55 |
ų | U+0173 | u | 0x75 |
Ŵ | U+0174 | W | 0x57 |
ŵ | U+0175 | w | 0x77 |
Ŷ | U+0176 | Y | 0x59 |
ŷ | U+0177 | y | 0x79 |
Ź | U+0179 | Z | 0x5A |
ź | U+017a | z | 0x7A |
Ż | U+017b | Z | 0x5A |
ż | U+017c | z | 0x7A |
ƀ | U+0180 | b | 0x62 |
Ɖ | U+0189 | D | 0xD0 |
Ƒ | U+0191 | ニ・ | 0x83 |
Ɨ | U+0197 | I | 0x49 |
ƚ | U+019a | l | 0x6C |
Ɵ | U+019f | O | 0x4F |
Ơ | U+01a0 | O | 0x4F |
ơ | U+01a1 | o | 0x6F |
ƫ | U+01ab | t | 0x74 |
Ʈ | U+01ae | T | 0x54 |
Ư | U+01af | U | 0x55 |
ư | U+01b0 | u | 0x75 |
ƶ | U+01b6 | z | 0x7A |
ǀ | U+01c0 | | | 0x7C |
ǃ | U+01c3 | ! | 0x21 |
Ǎ | U+01cd | A | 0x41 |
ǎ | U+01ce | a | 0x61 |
Ǐ | U+01cf | I | 0x49 |
ǐ | U+01d0 | i | 0x69 |
Ǒ | U+01d1 | O | 0x4F |
ǒ | U+01d2 | o | 0x6F |
Ǔ | U+01d3 | U | 0x55 |
ǔ | U+01d4 | u | 0x75 |
Ǖ | U+01d5 | U | 0x55 |
ǖ | U+01d6 | u | 0x75 |
Ǘ | U+01d7 | U | 0x55 |
ǘ | U+01d8 | u | 0x75 |
Ǚ | U+01d9 | U | 0x55 |
ǚ | U+01da | u | 0x75 |
Ǜ | U+01db | U | 0x55 |
ǜ | U+01dc | u | 0x75 |
Ǟ | U+01de | A | 0x41 |
ǟ | U+01df | a | 0x61 |
Ǥ | U+01e4 | G | 0x47 |
ǥ | U+01e5 | g | 0x67 |
Ǧ | U+01e6 | G | 0x47 |
ǧ | U+01e7 | g | 0x67 |
Ǩ | U+01e8 | K | 0x4B |
ǩ | U+01e9 | k | 0x6B |
Ǫ | U+01ea | O | 0x4F |
ǫ | U+01eb | o | 0x6F |
Ǭ | U+01ec | O | 0x4F |
ǭ | U+01ed | o | 0x6F |
ǰ | U+01f0 | j | 0x6A |
ɡ | U+0261 | g | 0x67 |
ʹ | U+02b9 | ' | 0x27 |
ʺ | U+02ba | " | 0x22 |
ʼ | U+02bc | ' | 0x27 |
˄ | U+02c4 | ^ | 0x5E |
ˈ | U+02c8 | ' | 0x27 |
ˉ | U+02c9 |  ̄ | 0xAF |
ˊ | U+02ca | ´ | 0xB4 |
ˋ | U+02cb | ` | 0x60 |
ˍ | U+02cd | _ | 0x5F |
˚ | U+02da | ° | 0xB0 |
̀ | U+0300 | ` | 0x60 |
́ | U+0301 | ´ | 0xB4 |
̂ | U+0302 | ^ | 0x5E |
̃ | U+0303 | ~ | 0x7E |
̄ | U+0304 |  ̄ | 0xAF |
̅ | U+0305 |  ̄ | 0xAF |
̈ | U+0308 | ¨ | 0xA8 |
̊ | U+030a | ° | 0xB0 |
̎ | U+030e | " | 0x22 |
̧ | U+0327 | 、 | 0xB8 |
̱ | U+0331 | _ | 0x5F |
̲ | U+0332 | _ | 0x5F |
; | U+037e | ; | 0x3B |
Γ | U+0393 | G | 0x47 |
Θ | U+0398 | T | 0x54 |
Σ | U+03a3 | S | 0x53 |
Φ | U+03a6 | F | 0x46 |
Ω | U+03a9 | O | 0x4F |
α | U+03b1 | a | 0x61 |
β | U+03b2 | s | 0xDF |
δ | U+03b4 | d | 0x64 |
ε | U+03b5 | e | 0x65 |
μ | U+03bc | μ | 0xB5 |
π | U+03c0 | p | 0x70 |
σ | U+03c3 | s | 0x73 |
τ | U+03c4 | t | 0x74 |
φ | U+03c6 | f | 0x66 |
һ | U+04bb | h | 0x68 |
։ | U+0589 | : | 0x3A |
٪ | U+066a | % | 0x25 |
U+2000 | 0x20 | ||
U+2001 | 0x20 | ||
U+2002 | 0x20 | ||
U+2003 | 0x20 | ||
U+2004 | 0x20 | ||
U+2005 | 0x20 | ||
U+2006 | 0x20 | ||
‐ | U+2010 | - | 0x2D |
‑ | U+2011 | - | 0x2D |
‗ | U+2017 | = | 0x3D |
․ | U+2024 | ・ | 0xB7 |
′ | U+2032 | ' | 0x27 |
‵ | U+2035 | ` | 0x60 |
⁄ | U+2044 | / | 0x2F |
⁰ | U+2070 | ° | 0xB0 |
⁴ | U+2074 | 4 | 0x34 |
⁵ | U+2075 | 5 | 0x35 |
⁶ | U+2076 | 6 | 0x36 |
⁷ | U+2077 | 7 | 0x37 |
⁸ | U+2078 | 8 | 0x38 |
ⁿ | U+207f | n | 0x6E |
₀ | U+2080 | 0 | 0x30 |
₁ | U+2081 | 1 | 0x31 |
₂ | U+2082 | 2 | 0x32 |
₃ | U+2083 | 3 | 0x33 |
₄ | U+2084 | 4 | 0x34 |
₅ | U+2085 | 5 | 0x35 |
₆ | U+2086 | 6 | 0x36 |
₇ | U+2087 | 7 | 0x37 |
₈ | U+2088 | 8 | 0x38 |
₉ | U+2089 | 9 | 0x39 |
₡ | U+20a1 | ¢ | 0xA2 |
₤ | U+20a4 | £ | 0xA3 |
₧ | U+20a7 | P | 0x50 |
ℂ | U+2102 | C | 0x43 |
ℇ | U+2107 | E | 0x45 |
ℊ | U+210a | g | 0x67 |
ℋ | U+210b | H | 0x48 |
ℌ | U+210c | H | 0x48 |
ℍ | U+210d | H | 0x48 |
ℎ | U+210e | h | 0x68 |
ℐ | U+2110 | I | 0x49 |
ℑ | U+2111 | I | 0x49 |
ℒ | U+2112 | L | 0x4C |
ℓ | U+2113 | l | 0x6C |
ℕ | U+2115 | N | 0x4E |
℘ | U+2118 | P | 0x50 |
ℙ | U+2119 | P | 0x50 |
ℚ | U+211a | Q | 0x51 |
ℛ | U+211b | R | 0x52 |
ℜ | U+211c | R | 0x52 |
ℝ | U+211d | R | 0x52 |
ℤ | U+2124 | Z | 0x5A |
ℨ | U+2128 | Z | 0x5A |
K | U+212a | K | 0x4B |
Å | U+212b | A | 0xC5 |
ℬ | U+212c | B | 0x42 |
ℭ | U+212d | C | 0x43 |
℮ | U+212e | e | 0x65 |
ℯ | U+212f | e | 0x65 |
ℰ | U+2130 | E | 0x45 |
ℱ | U+2131 | F | 0x46 |
ℳ | U+2133 | M | 0x4D |
ℴ | U+2134 | o | 0x6F |
∅ | U+2205 | O | 0xD8 |
− | U+2212 | - | 0x2D |
∓ | U+2213 | ± | 0xB1 |
∕ | U+2215 | / | 0x2F |
∖ | U+2216 | \ | 0x5C |
∗ | U+2217 | * | 0x2A |
∘ | U+2218 | ° | 0xB0 |
∙ | U+2219 | ・ | 0xB7 |
√ | U+221a | v | 0x76 |
∞ | U+221e | 8 | 0x38 |
∣ | U+2223 | | | 0x7C |
∩ | U+2229 | n | 0x6E |
∶ | U+2236 | : | 0x3A |
∼ | U+223c | ~ | 0x7E |
≈ | U+2248 | ヒ・ | 0x98 |
≡ | U+2261 | = | 0x3D |
≤ | U+2264 | = | 0x3D |
≥ | U+2265 | = | 0x3D |
≪ | U+226a | ≪ | 0xAB |
≫ | U+226b | ≫ | 0xBB |
⋅ | U+22c5 | ・ | 0xB7 |
⌂ | U+2302 | | | 0xA6 |
⌃ | U+2303 | ^ | 0x5E |
⌐ | U+2310 | ¬ | 0xAC |
⌠ | U+2320 | ( | 0x28 |
⌡ | U+2321 | ) | 0x29 |
〈 | U+2329 | < | 0x3C |
〉 | U+232a | > | 0x3E |
─ | U+2500 | - | 0x2D |
│ | U+2502 | | | 0xA6 |
┌ | U+250c | + | 0x2B |
┐ | U+2510 | + | 0x2B |
└ | U+2514 | + | 0x2B |
┘ | U+2518 | + | 0x2B |
├ | U+251c | + | 0x2B |
┤ | U+2524 | | | 0xA6 |
┬ | U+252c | - | 0x2D |
┴ | U+2534 | - | 0x2D |
┼ | U+253c | + | 0x2B |
═ | U+2550 | - | 0x2D |
║ | U+2551 | | | 0xA6 |
╒ | U+2552 | + | 0x2B |
╓ | U+2553 | + | 0x2B |
╔ | U+2554 | + | 0x2B |
╕ | U+2555 | + | 0x2B |
╖ | U+2556 | + | 0x2B |
╗ | U+2557 | + | 0x2B |
╘ | U+2558 | + | 0x2B |
╙ | U+2559 | + | 0x2B |
╚ | U+255a | + | 0x2B |
╛ | U+255b | + | 0x2B |
╜ | U+255c | + | 0x2B |
╝ | U+255d | + | 0x2B |
╞ | U+255e | | | 0xA6 |
╟ | U+255f | | | 0xA6 |
╠ | U+2560 | | | 0xA6 |
╡ | U+2561 | | | 0xA6 |
╢ | U+2562 | | | 0xA6 |
╣ | U+2563 | | | 0xA6 |
╤ | U+2564 | - | 0x2D |
╥ | U+2565 | - | 0x2D |
╦ | U+2566 | - | 0x2D |
╧ | U+2567 | - | 0x2D |
╨ | U+2568 | - | 0x2D |
╩ | U+2569 | - | 0x2D |
╪ | U+256a | + | 0x2B |
╫ | U+256b | + | 0x2B |
╬ | U+256c | + | 0x2B |
▀ | U+2580 |  ̄ | 0xAF |
▄ | U+2584 | _ | 0x5F |
█ | U+2588 | | | 0xA6 |
▌ | U+258c | | | 0xA6 |
▐ | U+2590 | | | 0xA6 |
░ | U+2591 | | | 0xA6 |
▒ | U+2592 | | | 0xA6 |
▓ | U+2593 | | | 0xA6 |
■ | U+25a0 | | | 0xA6 |
☼ | U+263c | ツ、 | 0xA4 |
❘ | U+2758 | | | 0x7C |
U+3000 | 0x20 | ||
〈 | U+3008 | < | 0x3C |
〉 | U+3009 | > | 0x3E |
《 | U+300a | ≪ | 0xAB |
》 | U+300b | ≫ | 0xBB |
〚 | U+301a | [ | 0x5B |
〛 | U+301b | ] | 0x5D |
・ | U+30fb | ・ | 0xB7 |
! | U+ff01 | ! | 0x21 |
" | U+ff02 | " | 0x22 |
# | U+ff03 | # | 0x23 |
$ | U+ff04 | $ | 0x24 |
% | U+ff05 | % | 0x25 |
& | U+ff06 | & | 0x26 |
' | U+ff07 | ' | 0x27 |
( | U+ff08 | ( | 0x28 |
) | U+ff09 | ) | 0x29 |
* | U+ff0a | * | 0x2A |
+ | U+ff0b | + | 0x2B |
, | U+ff0c | , | 0x2C |
- | U+ff0d | - | 0x2D |
. | U+ff0e | . | 0x2E |
/ | U+ff0f | / | 0x2F |
0 | U+ff10 | 0 | 0x30 |
1 | U+ff11 | 1 | 0x31 |
2 | U+ff12 | 2 | 0x32 |
3 | U+ff13 | 3 | 0x33 |
4 | U+ff14 | 4 | 0x34 |
5 | U+ff15 | 5 | 0x35 |
6 | U+ff16 | 6 | 0x36 |
7 | U+ff17 | 7 | 0x37 |
8 | U+ff18 | 8 | 0x38 |
9 | U+ff19 | 9 | 0x39 |
: | U+ff1a | : | 0x3A |
; | U+ff1b | ; | 0x3B |
< | U+ff1c | < | 0x3C |
= | U+ff1d | = | 0x3D |
> | U+ff1e | > | 0x3E |
@ | U+ff20 | @ | 0x40 |
A | U+ff21 | A | 0x41 |
B | U+ff22 | B | 0x42 |
C | U+ff23 | C | 0x43 |
D | U+ff24 | D | 0x44 |
E | U+ff25 | E | 0x45 |
F | U+ff26 | F | 0x46 |
G | U+ff27 | G | 0x47 |
H | U+ff28 | H | 0x48 |
I | U+ff29 | I | 0x49 |
J | U+ff2a | J | 0x4A |
K | U+ff2b | K | 0x4B |
L | U+ff2c | L | 0x4C |
M | U+ff2d | M | 0x4D |
N | U+ff2e | N | 0x4E |
O | U+ff2f | O | 0x4F |
P | U+ff30 | P | 0x50 |
Q | U+ff31 | Q | 0x51 |
R | U+ff32 | R | 0x52 |
S | U+ff33 | S | 0x53 |
T | U+ff34 | T | 0x54 |
U | U+ff35 | U | 0x55 |
V | U+ff36 | V | 0x56 |
W | U+ff37 | W | 0x57 |
X | U+ff38 | X | 0x58 |
Y | U+ff39 | Y | 0x59 |
Z | U+ff3a | Z | 0x5A |
[ | U+ff3b | [ | 0x5B |
\ | U+ff3c | \ | 0x5C |
] | U+ff3d | ] | 0x5D |
^ | U+ff3e | ^ | 0x5E |
_ | U+ff3f | _ | 0x5F |
` | U+ff40 | ` | 0x60 |
a | U+ff41 | a | 0x61 |
b | U+ff42 | b | 0x62 |
c | U+ff43 | c | 0x63 |
d | U+ff44 | d | 0x64 |
e | U+ff45 | e | 0x65 |
f | U+ff46 | f | 0x66 |
g | U+ff47 | g | 0x67 |
h | U+ff48 | h | 0x68 |
i | U+ff49 | i | 0x69 |
j | U+ff4a | j | 0x6A |
k | U+ff4b | k | 0x6B |
l | U+ff4c | l | 0x6C |
m | U+ff4d | m | 0x6D |
n | U+ff4e | n | 0x6E |
o | U+ff4f | o | 0x6F |
p | U+ff50 | p | 0x70 |
q | U+ff51 | q | 0x71 |
r | U+ff52 | r | 0x72 |
s | U+ff53 | s | 0x73 |
t | U+ff54 | t | 0x74 |
u | U+ff55 | u | 0x75 |
v | U+ff56 | v | 0x76 |
w | U+ff57 | w | 0x77 |
x | U+ff58 | x | 0x78 |
y | U+ff59 | y | 0x79 |
z | U+ff5a | z | 0x7A |
{ | U+ff5b | { | 0x7B |
| | U+ff5c | | | 0x7C |
} | U+ff5d | } | 0x7D |
~ | U+ff5e | ~ | 0x7E |
UnicodeからISO-8859-1への変換の場合には、
たとえば、
問題を引き起こす「似た文字への変換」
このような多対一での文字の変換によって引き起こされるセキュリティ上の問題の一例としては、
パストラバーサル
UnicodeからShift_
また、
0x5Cや0x2FはWindowsにおけるディレクトリの区切りとして使用する文字ですので、
クロスサイトスクリプティング
UnicodeからISO-8859-1への変換では、
前述のパストラバーサル同様、
このように、
- Unicodeで文字列の検査を行う
- Unicodeから他のエンコーディングに変換
- 変換された文字列を使用する
といった順序のときに、
次回は、