Re: Re[2]: [PHP] Japanese with UTF-8 and mysql

2005-06-03 Thread Peter Brodersen
On Thu, 2 Jun 2005 11:58:26 +0100, in php.general
[EMAIL PROTECTED] (Richard Davey) wrote:

I would recommend setting UTF-8 as the Content-type via PHP itself:
header('Content-type: UTF-8') - do it as one of the first things when
you're ready to output the HTML.

UTF-8 is a charset, not a Content-type.

A quick test shows that the HTTP header output from Apache would
contain:
Content-Type: UTF-8

The correct way - if one wants utf-8 as charset - is:
header(Content-Type: index/html; charset=utf-8);

-- 
- Peter Brodersen

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] Japanese with UTF-8 and mysql

2005-06-02 Thread Richard Davey
Hello Mark,

Thursday, June 2, 2005, 4:18:30 AM, you wrote:

MS ?php
MS session_start();
MS include(database.php);
?

I would recommend setting UTF-8 as the Content-type via PHP itself:
header('Content-type: UTF-8') - do it as one of the first things when
you're ready to output the HTML.

MS !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
MS http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;

This may well be a cause of the problem - your HTML doesn't look like
it's XTHML Strict compatible at all, so browsers are going to
re-render it (IE into Quirks mode). I would remove the DocType for now
or fix the mark-up errors.

MS ?php
MS if (isset($_REQUEST[product_id])) {
MS$product_id = $_REQUEST[product_id];

See the previous reply about why this isn't safe, but also it should
be: $_REQUEST['product_id'] (note the quotes) to avoid PHP scanning
for constants.

MS for ($i=0; $i$num; $i++){
MS echo tr align=\center\tdPRODUCT 
MS NAME/tdtd.$rows['product_name']./tdbrtr 

From a code point of view this is correct. Let's check a few obvious
things: does PHP have the mb extension installed? If so what is the
default character-set in php.ini?

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 I do not fear computers. I fear the lack of them. - Isaac Asimov

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php