Using SHIFT_JIS text in PHP
- by Joe Corkery
I am building a form that needs to accept characters encoded in SHIFT_JIS and then send those results via email to a recipient. I've tried to simply capture the results from the $_POST variable and then to insert them into a block of text like this:
$contents = <<<TEST
Name: $NameJp
...
TEST
but that doesn't appear to work (which doesn't really surprise me). This is my first attempt at dealing with non-ASCII characters in PHP and I am hoping that people might have some suggestions. Perhaps I am missing a simple function to encode the text.
Also, are there any other potential pitfalls that I might encounter?
Thanks.