|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42295 mcrypt outputs are latin1 instead of utf8
Submitted: 2007-08-14 12:44 UTC Modified: 2007-08-14 13:31 UTC
From: webmaster at philcorda dot de Assigned:
Status: Not a bug Package: mcrypt related
PHP Version: 5CVS-2007-08-14 (CVS) OS: Suse Linux 9.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: webmaster at philcorda dot de
New email:
PHP Version: OS:


 [2007-08-14 12:44 UTC] webmaster at philcorda dot de
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:

Expected result:
utf-8 strings

Actual result:
latin1 strings


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-14 12:57 UTC]
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 13:31 UTC] webmaster at philcorda dot de
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?
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 05:01:29 2024 UTC