Re: Where to Begin?
| From: | Leung WC | Date: | Fri, 02 Apr 2004 18:16:04 +0000 |
| Subject: | Re: Where to Begin? | ||
| References: | 1 | Groups: | php.i18n |
| Request: | Send a blank email to php-i18n+get-680@lists.php.net to get a copy of this message | ||
Jamie wrote:
Hi, i've been doing a little php programming for a while now, as well as interacting with japanese data and mysql. But now i need to rewrite my site to account for the possibility of mutliple languages being used on the one page. What i had intended to do was to store everything in the database as UTF-8, and to output the html pages as UTF-8. I've read about the slashes issues and the internal encoding issues and i think i understand. But, if i have a page that requires input in Japanese and Hangul, what should i set the internal encoding as:No. The browser converts all of them to UTF-8 instead. If browser fails to do it (esp Opera), then change your browser. So, you can forget this issue in PHP.mbstring.internal_encoding = UTF-8What i'm not too sure about is, if the user uses an IME with SJIS to input japanese, and then another IME to inpout the Korean, does PHP convert this to UTF-8? And if i need to fill the form back in (mistakes or omissions) do i need to convert the text back to some other format?
If i pull UTF-8 text from a DB,how or do i need to convert it (to SJIS for example) to fill i a form?Again... forget it. Simply send the form in UTF-8 and people will answer in UTF-8
Lastly, would it be advisable to give users the ability to output a HTML page in another character set (UTF default -> User wants SJIS) as long as their are only japanese charaters to display?No. Popular browsers (IE and Mozilla) have absolutely no difficulties using UTF-8. In the other way, having encoding conversions adds complexity to your program (it is also easy to do it wrong!). Today I was reading a web diary that the writer submitted a essay in SJIS when it should be BIG5. Nightmare...
Sorry if i don't exactly make much sense, i'm still trying to come to terms with dealing with multiple character sets and IME's. Many Thanks Jamie