PHP error message encoding

I have a WebServer on Windows.

In .htaccess:

AddDefaultCharset utf-8 php_value mbstring.internal_encoding utf-8 php_value default_charset utf-8 

In the script:

 header("Content-Type: text/html; charset=utf-8"); ftp_connect("1"); 

In a browser in UTF-8:

 Warning: ftp_connect() [function.ftp-connect]: php_network_getaddresses: getaddrinfo failed:                     . ( 

Question. Why is the error message not specified in UTF-8?

+4
source share
1 answer

It looks like PHP has nothing to do with the error message right from "getaddrinfo failed:". Misrepresented characters come from different sources - here from the ftp server. You checked both the web server and PHP, but not the ftp server configuration.

It would be best to check the ftp server.

You can check another error message below your code

 header("Content-Type: text/html; charset=utf-8"); ftp_connect("1"); //generate some mess resulting in error info file_get_contents('forsurenonexistingfile'); 

if your error information falls into the correct representation of the character, the mystery is gone.

0
source

All Articles