Also, are there any other potential pitfalls that I might encounter?
Yes. :)
It's all fine and good to receive text in SHIFT_JIS, but you'll have to handle it like SHIFT_JIS all the way after that and inform everybody else that this text is in SHIFT_JIS. I.e., if you insert it into an email, you'll need to set appropriate email headers informing clients that this email contains text in SHIFT_JIS. If you need to display it on a web page or just in debug, you'll need to make sure the browser or debugging environment handles the text as SHIFT_JIS. If you mix it with other text, you should make sure they're in the same encoding.
Honestly, SHIFT_JIS is antiquated and terrible to work with. You should use UTF-8 if at all possible. If you absolutely, positively need to accept SHIFT_JIS and do a lot of work on it, you may want to convert it to UTF-8 internally and convert it back to whatever output encoding is necessary when the time comes. You can use iconv
to do so.
Email headers are special BTW in that they can not contain anything but ASCII characters. The subject of an email is part of the header. To send non-ASCII characters as a subject line, you'll need to MIME encode it using mb_encode_mimeheader
.
Also, the obligatory reference to: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)