473,382 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Unicode for HTTP Header

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
Jun 2 '08 #1
8 2745
ks******@gmail.com escribió:
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
--
Jun 2 '08 #2
ks******@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
Jun 2 '08 #3
Ã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:
ks******@gmail.com escribi�:
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
--
Jun 2 '08 #4
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
Jun 2 '08 #5
ks******@gmail.com wrote:
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.
js*******@attglobal.net
==================
Jun 2 '08 #6
On May 22, 5:43*pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
ksura...@gmail.com wrote:
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
Jun 2 '08 #7
On May 22, 5:43*pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
ksura...@gmail.com wrote:
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 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.
Jun 2 '08 #8
Satya wrote:
On May 22, 5:43 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>ksura...@gmail.com wrote:
>>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.
js*******@attglobal.net
==================
Jun 2 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Gerson Kurz | last post by:
AAAAAAAARG I hate the way python handles unicode. Here is a nice problem for y'all to enjoy: say you have a variable thats unicode directory = u"c:\temp" Its unicode not because you want it...
8
by: Bill Eldridge | last post by:
I'm trying to grab a document off the Web and toss it into a MySQL database, but I keep running into the various encoding problems with Unicode (that aren't a problem for me with GB2312, BIG 5,...
30
by: aurora | last post by:
I have long find the Python default encoding of strict ASCII frustrating. For one thing I prefer to get garbage character than an exception. But the biggest issue is Unicode exception often pop up...
48
by: Zenobia | last post by:
Recently I was editing a document in GoLive 6. I like GoLive because it has some nice features such as: * rewrite source code * check syntax * global search & replace (through several files at...
30
by: Anon | last post by:
If Http headers specify the character encoding, what is the point of the Meta tag specifying it?
4
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3...
2
by: Neil Schemenauer | last post by:
python-dev@python.org.] The PEP has been rewritten based on a suggestion by Guido to change str() rather than adding a new built-in function. Based on my testing, I believe the idea is...
5
by: Jamie | last post by:
I have a file that was written using Java and the file has unicode strings. What is the best way to deal with these in C? The file definition reads: Data Field Description CHAR File...
3
by: roland.saad | last post by:
Hi Everyone, I have been trying to build a website that has multilingual support using the LAMP setup. I have created tables that store language information and correlate different strings ids...
18
by: Chameleon | last post by:
I am trying to #define this: #ifdef UNICODE_STRINGS #define UC16 L typedef wstring String; #else #define UC16 typedef string String; #endif ....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.