String to encode.
Whether to skip characters that don't exist in SJIS or throw an exception.
assert(toSJIS("Hello.") == SJISString([0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2e])); assert(toSJIS("Hello.") == SJISString([0x82, 0x67, 0x82, 0x85, 0x82, 0x8c, 0x82, 0x8c, 0x82, 0x8f, 0x81, 0x44])); assert(toSJIS("Hello."d) == SJISString([0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2e])); assert(toSJIS("Hello."d) == SJISString([0x82, 0x67, 0x82, 0x85, 0x82, 0x8c, 0x82, 0x8c, 0x82, 0x8f, 0x81, 0x44])); assert(toSJIS("Hello."w) == SJISString([0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2e])); assert(toSJIS("Hello."w) == SJISString([0x82, 0x67, 0x82, 0x85, 0x82, 0x8c, 0x82, 0x8c, 0x82, 0x8f, 0x81, 0x44]));
Encodes a unicode string as SJIS.
Note: Badly-formed unicode strings will always fail.