#42295 [Bgs]: mcrypt outputs are latin1 instead of utf8

From: Date: Tue, 14 Aug 2007 13:31:29 +0000
Subject: #42295 [Bgs]: mcrypt outputs are latin1 instead of utf8
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-116067@lists.php.net to get a copy of this message
 ID:               42295
 User updated by:  webmaster at philcorda dot de
 Reported By:      webmaster at philcorda dot de
 Status:           Bogus
 Bug Type:         mcrypt related
 Operating System: Suse Linux 9.3
 PHP Version:      5CVS-2007-08-14 (CVS)
 New Comment:

Thanks, that's a good way but when I print the output of mcrypt with
echo then it's definitively ISO-8859-1/latin1.
All the other chars on the webpage you can see but only these strings
are questionmarks. When you change your charset to ISO you can see them!
So I think it's ISO --> When it's binary why does it give out ISO with
echo?


Previous Comments:
------------------------------------------------------------------------

[2007-08-14 12:57:33] johannes@php.net

mcrypt produces binary output which is neither iso-8859-1 nor utf-8
therefore you should tell your database that that data is binary stuff,
not text data.

------------------------------------------------------------------------

[2007-08-14 12:44:59] webmaster at philcorda dot de

Description:
------------
Today, I tried to use mcrypt with utf8.
The background was a mysql-connection running in utf8-mode and for this
reason all the transfered strings have to be encoded in utf8.
I set the default charset in the php.ini to utf-8 and php works fine
but then I tried to encrypt strings with mcrypt and all the strings
where given out in latin1 / ISO-8859-1 instead of utf-8.

I don't know why mcrypt delivers the strings in latin1 instead of utf-8
but I would be happy if this bug could be solved 'till next version.

For this time I'll use utf8_encode().

Reproduce code:
---------------
Irrelevant

Expected result:
----------------
utf-8 strings

Actual result:
--------------
latin1 strings


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=42295&edit=1


Thread (3 messages)

« previous php.bugs (#116067) next »