/* Unicode 0x5C is a backslash; but Shift-JIS uses 0x5C for the
* Yen sign. JIS X 0208 kuten 0x2140 is a backslash. */
s1 = 0x2140;
+ } else if (c == 0x7E) {
+ /* Unicode 0x7E is a tilde, but Shift-JIS uses 0x7E for overline (or
+ * macron). JIS X 0208 kuten 0x2141 is 'WAVE DASH' */
+ s1 = 0x2141;
} else if (c >= ucs_a1_jis_table_min && c < ucs_a1_jis_table_max) {
s1 = ucs_a1_jis_table[c - ucs_a1_jis_table_min];
} else if (c >= ucs_a2_jis_table_min && c < ucs_a2_jis_table_max) {
0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
-0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
+0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x2141,0x007F,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
}
}
}
-$fromUnicode["\x00\x7E"] = "\x7E"; /* Not reversible; SJIS 0x7E -> U+203E */
+
+/* U+007E is TILDE, Shift-JIS 0x8160 is WAVE DASH */
+$fromUnicode["\x00\x7E"] = "\x81\x60";
/* U+005C is backslash, Shift-JIS 0x815F is REVERSE SOLIDUS
* (ie. a fancy way to say "backslash") */
$fromUnicode["\x00" . chr($i)] = chr($i);
}
+/* U+007E is TILDE; convert to Shift-JIS 0x8160 (WAVE DASH) */
+$fromUnicode["\x00\x7E"] = "\x81\x60";
/* DEL character */
$validChars["\x7F"] = "\x00\x7F";
$fromUnicode["\x00\x7F"] = "\x7F";
-/* Although Shift-JIS uses 0x7E for an overline, we will map Unicode 0x7E
- * (tilde) to Shift-JIS 0x7E (as iconv does) */
-$fromUnicode["\x00\x7E"] = "\x7E";
/* Use fullwidth reverse solidus, not (halfwidth) backslash (0x5C) */
$validChars["\x81\x5F"] = "\xFF\x3C";
$fromUnicode["\xFF\x3C"] = "\x81\x5F";