The simplest way I’ve found to restrict the entry of characters to only allow entry of valid Shift-JIS characters is just to check each character in the input field and throw an error on the entry of an invalid character.
タグアーカイブ:SJIS
Full-width to Half-width Katakana Conversion using Javascript
Since the byte characters and lengths are different for full-width and half-width versions of katakana, most Japanese web applications resolve this issue by auto-converting full-width katakana characters into half-width katakana characters.