php-i18n Digest 22 Sep 2002 04:40:06 -0000 Issue 124

Topics (messages 320 through 326):

Re: header("location: ") causes GET vars to be encoded in wrong charset in IE5.5
        320 by: Jean-Christian Imbeault

Re: ISO to EUC convertion
        321 by: Jean-Christian Imbeault

Re: [PHP] BUG?: header("location: ") causes GET vars to be encoded in wrong charset in 
IE5.5
        322 by: Chris Shiflett
        323 by: Chris Shiflett
        324 by: . Edwin
        325 by: . Edwin

help urgent
        326 by: bhupal adhikari

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
I have the following code which works fine in Netscape7 but doesn't in IE5.5

$maker_name   = $_POST["maker_name"];

$loc = "show_products.php?maker_name=$maker_name&".SID;

header("Location: $loc");

The problem is that the POST variables are coming in EUC-JP (japanese) 
correctly but for some reason IE re-encodes the variable into some other 
charset (SJIS I am guessing) when requesting the new page sent in the 
Header("location: ") ...

So in Netscape I get redirected to this page:

http://192.168.254.14/show_products_html.php?&maker_name=%C5%ED&PHPSESSID=34fbfc3284514b75887c0a6a593b919c

But in IE I get this instead:

http://192.168.254.14/show_products.php?maker_name=??&;


Is this a bug in IE (of course it is ;)? Is there a work around?

Help!

Jc

--- End Message ---
--- Begin Message ---
Prabahar wrote:
>
> I have requirement like this... Read a TEXT file that has codes that 
> represents Japanese chars in iso-8859-1 encoding. 
> 
>     $str=mb_convert_encoding ( $data[0], "EUC-JP", "ASCII") . "\n";

Your file is not in ASCII. Try ISO-8859-1 instead ..

Jc

--- End Message ---
--- Begin Message ---
You should always use a proper full URL in the Location header. Try that 
first.

header("Location: 
http://192.168.254.14/show_products_html.php?&maker_name=$maker_name&PHPSESSID=$PHPSESSID";);

I doubt this will solve your problem, but it is good practice anyway.

One thing that would help debug a problem like this is to try and view 
the raw HTTP, because that will lend some insight as to what character 
encoding the Web clients (IE and Netscape) are declaring. My guess is 
that the problem lies with the POST (when you receive the maker_name 
form variable), because HTTP itself has an ISO-8859-1 character encoding 
by definition, so there should be no ambiguity there. Variables that are 
posted are contained in the content of the HTTP message itself which is 
subject to interpretation based on content encoding.

Anyway, hope that lends some insight and gives you some ideas.

Happy hacking.

Chris

Jean-Christian Imbeault wrote:

> I have the following code which works fine in Netscape7 but doesn't in 
> IE5.5
>
> $maker_name   = $_POST["maker_name"];
>
> $loc = "show_products.php?maker_name=$maker_name&".SID;
>
> header("Location: $loc");
>
> The problem is that the POST variables are coming in EUC-JP (japanese) 
> correctly but for some reason IE re-encodes the variable into some 
> other charset (SJIS I am guessing) when requesting the new page sent 
> in the Header("location: ") ...
>
> So in Netscape I get redirected to this page:
>
> 
>http://192.168.254.14/show_products_html.php?&maker_name=%C5%ED&PHPSESSID=34fbfc3284514b75887c0a6a593b919c
> 
>
>
> But in IE I get this instead:
>
> http://192.168.254.14/show_products.php?maker_name=??&;
>
>
> Is this a bug in IE (of course it is ;)? Is there a work around?
>
> Help!
>
> Jc
>
>


--- End Message ---
--- Begin Message ---
I also just noticed that your first variable in the query string (which 
begins after the ? character) begins with an &, which is a separator 
character. I'm not sure what's going on there, but it should be 
something more like this:

header("Location: 
http://192.168.254.14/show_products_html.php?maker_name=$maker_name&PHPSESSID=$PHPSESSID";);
 


Happy hacking.

Chris

> Jean-Christian Imbeault wrote:
>
>> 
>http://192.168.254.14/show_products_html.php?&maker_name=%C5%ED&PHPSESSID=34fbfc3284514b75887c0a6a593b919c
> 
>
>

--- End Message ---
--- Begin Message ---
And by the way, please check the NOTE: on
http://jp2.php.net/manual/en/function.header.php for the use of header().
Something's missing in the way you used it--perhaps, this is causing the
problem...

- E

<quoted>
Note:  HTTP/1.1 requires an absolute URI as argument to Location:  including
the scheme, hostname and absolute path, but some clients accept relative
URIs. You can usually use $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF']  and
dirname() to make an absolute URI from a relative one yourself:

header("Location: http://".$_SERVER['HTTP_HOST']
                      .dirname($_SERVER['PHP_SELF'])
                      ."/".$relative_url);
</quoted>

On Tuesday, September 10, 2002 3:15 PM


> Hello,
>
> On Tuesday, September 10, 2002 1:52 PM
> Jean-Christian Imbeault wrote:
>
> <snip>
> > The problem is that the POST variables are coming in EUC-JP (japanese)
> > correctly but for some reason IE re-encodes the variable into some other
> > charset (SJIS I am guessing) when requesting the new page sent in the
> > Header("location: ") ...
> </snip>
>
> I just wonder how do you know that the POST variable are in EUC-JP. Did
you
> set this in your ini? Or, did you encode your php files in EUC-JP and you
> have the directive inside <meta> tags?
>
> I think you may want to play with these settings:
>
>   mbstring.internal_encoding
>   mbstring.http_input
>   mbstring.http_output
>   mbstring.detect_order
>
> Or, you can try the "Multi-Byte String Functions" (
> http://jp2.php.net/manual/en/ref.mbstring.php ) to convert from one
encoding
> to another. Just experiment a bit... still if nothing works, perhaps, we
can
> try something again later...
>
> - E
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hello,

On Tuesday, September 10, 2002 1:52 PM
Jean-Christian Imbeault wrote:

<snip>
> The problem is that the POST variables are coming in EUC-JP (japanese)
> correctly but for some reason IE re-encodes the variable into some other
> charset (SJIS I am guessing) when requesting the new page sent in the
> Header("location: ") ...
</snip>

I just wonder how do you know that the POST variable are in EUC-JP. Did you
set this in your ini? Or, did you encode your php files in EUC-JP and you
have the directive inside <meta> tags?

I think you may want to play with these settings:

  mbstring.internal_encoding
  mbstring.http_input
  mbstring.http_output
  mbstring.detect_order

Or, you can try the "Multi-Byte String Functions" (
http://jp2.php.net/manual/en/ref.mbstring.php ) to convert from one encoding
to another. Just experiment a bit... still if nothing works, perhaps, we can
try something again later...

- E

--- End Message ---
--- Begin Message ---
hello

i am facing this problem


Warning: Failed opening '/home/skc/public_html/asstry/get_info.php' for
inclusion (include_path='.:/opt/Apache/PHP/lib/php') in Unknown on line 0

Do any of you know what this means ??

b



--- End Message ---

Reply via email to