0

I am trying to set UTF-8 charset for my web server. Below is the sample header I am sending.

Request Method: GET
Status Code: 401 / Unauthorized

Response header is:

Content-type: text/html; charset=UTF-8
WWW-Authenticate: Basic realm=10.102.147.190

But for different browsers I am getting different values: IE is encoding Latin Character Small E:test as Pzp0ZXN0, chrome as 4bSHOnRlc3Q= and firefox as Bzp0ZXN0

as a result, the username is different when entered from different browsers. I googled this quite a but, but seems setting the "charset=utf-8" is the only solution, which is not working in my case. let me know how to solve this issue.

Any help is much appreciated. Thanks in advance.

hassan
  • 7,812
  • 2
  • 25
  • 36
user804195
  • 31
  • 1
  • you have many options : `.htaccess` with `php_value default_charset UTF-8`, + encode all php pages `UTF 8 w/o BOM` + make sure when usind DB to set proper encoding. But if you need ISO somewhere else, that'll put you into troubles... Some reading [HERE](http://stackoverflow.com/questions/7809931/how-to-force-utf-8-encoding-in-browser) and [HERE](http://stackoverflow.com/questions/913869/how-to-change-the-default-encoding-to-utf-8-for-apache) might help, I hope so – OldPadawan Apr 17 '17 at 08:22
  • If the question is about character encoding the Basic auth credentials, you may want to look at https://greenbytes.de/tech/webdav/rfc7617.html#charset and hope for this to get implemented in browsers and servers soonish... – Julian Reschke Apr 17 '17 at 09:16

0 Answers0