Connecting Tech Pros Worldwide Forums | Help | Site Map

Unicode for HTTP Header

ksuralta@gmail.com
Guest
 
Posts: n/a
#1: Jun 2 '08
Hi everyone,

Good day!

This isn't actually a PHP question.
I just want to ask if it's possible to use double byte character
strings as the basic realm in the HTTP header.

example.
WWW-Authenticate: Basic realm="<dbcs>"

I'm getting garbage characters displayed.
If this is possible, how do I do it?

Thanks,
Kenneth

=?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?=
Guest
 
Posts: n/a
#2: Jun 2 '08

re: Unicode for HTTP Header


ksuralta@gmail.com escribió:
Quote:
I just want to ask if it's possible to use double byte character
strings as the basic realm in the HTTP header.
>
example.
WWW-Authenticate: Basic realm="<dbcs>"
If HTTP headers are allowed contain values in any charset I presume
you'd need to encode them properly following the rules in rfc2047, just
as you do with e-mail MIME headers. PHP has lots of built-in functions
to _decode_ but I'm not sure about which one should be used to encode.
Maybe mb_encode_mimeheader()?

Another issue is whether browsers will be able to decode it. This test
does not work at all in Opera, Firefox or IE 7:

<?php
header('WWW-Authenticate: Basic realm="=?US-ASCII?Q?foo?="');
?>

There's a discussion about the subject in Mozilla's bug tracker:

https://bugzilla.mozilla.org/show_bug.cgi?id=41489


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
Guillaume
Guest
 
Posts: n/a
#3: Jun 2 '08

re: Unicode for HTTP Header


ksuralta@gmail.com a écrit :
Quote:
This isn't actually a PHP question.
I wonder, why asking here then ? I doubt this could be the best place to
get an accurate reply, though you might get it. I'd rather post in some
browser/webmaster/html expert NG.

--
Guillaume
ksuralta@gmail.com
Guest
 
Posts: n/a
#4: Jun 2 '08

re: Unicode for HTTP Header


Ãlvaro.,

I've tried your suggestion, and, yeah, the browsers are not decoding
it.

Anyway, your reply was very informative.

Thanks,
Kenneth


Ãlvaro G. Vicario wrote:
Quote:
ksuralta@gmail.com escribi�:
Quote:
I just want to ask if it's possible to use double byte character
strings as the basic realm in the HTTP header.

example.
WWW-Authenticate: Basic realm="<dbcs>"
>
If HTTP headers are allowed contain values in any charset I presume
you'd need to encode them properly following the rules in rfc2047, just
as you do with e-mail MIME headers. PHP has lots of built-in functions
to _decode_ but I'm not sure about which one should be used to encode.
Maybe mb_encode_mimeheader()?
>
Another issue is whether browsers will be able to decode it. This test
does not work at all in Opera, Firefox or IE 7:
>
<?php
header('WWW-Authenticate: Basic realm="=?US-ASCII?Q?foo?="');
?>
>
There's a discussion about the subject in Mozilla's bug tracker:
>
https://bugzilla.mozilla.org/show_bug.cgi?id=41489
>
>
--
-- http://alvaro.es - �lvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programaci�n web: http://bits.demogracia.com
-- Mi web de humor al ba�o Mar�a: http://www.demogracia.com
--
ksuralta@gmail.com
Guest
 
Posts: n/a
#5: Jun 2 '08

re: Unicode for HTTP Header


Sorry for that. I was quite in a hurry to fix this problem.

On May 22, 6:27 pm, Guillaume <ggra...@NOSPAM.gmail.com.INVALID>
wrote:
Quote:
ksura...@gmail.com a écrit :This isn't actually a PHP question.
>
I wonder, why asking here then ? I doubt this could be the best place to
get an accurate reply, though you might get it. I'd rather post in some
browser/webmaster/html expert NG.
>
--
Guillaume
Jerry Stuckle
Guest
 
Posts: n/a
#6: Jun 2 '08

re: Unicode for HTTP Header


ksuralta@gmail.com wrote:
Quote:
Sorry for that. I was quite in a hurry to fix this problem.
>
On May 22, 6:27 pm, Guillaume <ggra...@NOSPAM.gmail.com.INVALID>
wrote:
Quote:
>ksura...@gmail.com a écrit :This isn't actually a PHP question.
>>
>I wonder, why asking here then ? I doubt this could be the best place to
>get an accurate reply, though you might get it. I'd rather post in some
>browser/webmaster/html expert NG.
>>
>--
>Guillaume
>
All the more reason to ask in an appropriate newsgroup. You'll get a
good answer faster.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Satya
Guest
 
Posts: n/a
#7: Jun 2 '08

re: Unicode for HTTP Header


On May 22, 5:43*pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
ksura...@gmail.com wrote:
Quote:
Sorry for that. *I was quite in a hurry to fix this problem.
>
Quote:
On May 22, 6:27 pm, Guillaume <ggra...@NOSPAM.gmail.com.INVALID>
wrote:
Quote:
ksura...@gmail.com a écrit :This isn't actually a PHP question.
>
Quote:
Quote:
I wonder, why asking here then ? I doubt this could be the best place to
get an accurate reply, though you might get it. I'd rather post in some
browser/webmaster/html expert NG.
>
Quote:
Quote:
--
Guillaume
>
All the more reason to ask in an appropriate newsgroup. *You'll get a
good answer faster.
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Everywhere Jerry Stuckle. I want to know about him. i wrote an email,
instead two emails. for one i got this is not related to business and
for another i did not received anything.
Do you have any info about him. Please write me.

Thanks
Satya
Guest
 
Posts: n/a
#8: Jun 2 '08

re: Unicode for HTTP Header


On May 22, 5:43*pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
ksura...@gmail.com wrote:
Quote:
Sorry for that. *I was quite in a hurry to fix this problem.
>
Quote:
On May 22, 6:27 pm, Guillaume <ggra...@NOSPAM.gmail.com.INVALID>
wrote:
Quote:
ksura...@gmail.com a écrit :This isn't actually a PHP question.
>
Quote:
Quote:
I wonder, why asking here then ? I doubt this could be the best place to
get an accurate reply, though you might get it. I'd rather post in some
browser/webmaster/html expert NG.
>
Quote:
Quote:
--
Guillaume
>
All the more reason to ask in an appropriate newsgroup. *You'll get a
good answer faster.
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Everywhere with correct and informative answers. I am very impressed
with him.
I am not talking about the answers given here. ;)
The problem was already solved.
Jerry Stuckle
Guest
 
Posts: n/a
#9: Jun 2 '08

re: Unicode for HTTP Header


Satya wrote:
Quote:
On May 22, 5:43 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
>ksura...@gmail.com wrote:
Quote:
>>Sorry for that. I was quite in a hurry to fix this problem.
>>On May 22, 6:27 pm, Guillaume <ggra...@NOSPAM.gmail.com.INVALID>
>>wrote:
>>>ksura...@gmail.com a écrit :This isn't actually a PHP question.
>>>I wonder, why asking here then ? I doubt this could be the best place to
>>>get an accurate reply, though you might get it. I'd rather post in some
>>>browser/webmaster/html expert NG.
>>>--
>>>Guillaume
>All the more reason to ask in an appropriate newsgroup. You'll get a
>good answer faster.
>>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>jstuck...@attglobal.net
>==================
>
Everywhere Jerry Stuckle. I want to know about him. i wrote an email,
instead two emails. for one i got this is not related to business and
for another i did not received anything.
Do you have any info about him. Please write me.
>
Thanks
I show no email from your gmail address, going back three months.

Additionally, I help in the newsgroups in my free time. But answering
private email started to take too much of my billable time, so I had to
go that way.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Closed Thread


Similar PHP bytes