Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

encoding of $_SERVER vars?

I need to know if i can safely use normal string or I have to use mb_* string when I work on $_SERVER vars. (UTF-8)

For example $_SERVER['HTTP_HOST'] can contain multibyte chars?

What happens if i make an http request with Host: header containing multybyte chars?
And where a client can specify which econding is using when he makes an http request?

like image 855
dynamic Avatar asked Oct 09 '22 17:10

dynamic


1 Answers

Yes, you should use multibyte. If not for anything else, there are cyrillic domain names, so $_SERVER should naturally include utf8 data.

like image 126
Tony Bogdanov Avatar answered Oct 12 '22 09:10

Tony Bogdanov