diff --git a/httprl.module b/httprl.module index e070611..19912e2 100644 --- a/httprl.module +++ b/httprl.module @@ -233,8 +233,9 @@ function httprl_request($url, $options = array()) { // Make sure the socket opened properly. if (!$fp) { - // Convert error message to utf-8. - $errstr = iconv('utf-8', 'utf-8//IGNORE', $errstr); + // Convert error message to utf-8. Using ISO-8859-1 (Latin-1) as source + // encoding could be wrong; it is a simple workaround :) + $response->error = drupal_convert_to_utf8($errstr, 'ISO-8859-1'); if (!$errno) { // If $errno is 0, it is an indication that the error occurred // before the connect() call. This is most likely due to a problem