Using SHIFT_JIS text in PHP

Posted by Joe Corkery on Stack Overflow See other posts from Stack Overflow or by Joe Corkery
Published on 2010-05-27T01:49:30Z Indexed on 2010/05/27 2:11 UTC
Read the original article Hit count: 267

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about php

Related posts about unicode