|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2019-08-29 11:58 UTC] turchanov at farpost dot com
[2019-12-20 10:24 UTC] nikic@php.net
[2019-12-20 10:24 UTC] nikic@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 13:00:01 2025 UTC |
Description: ------------ after mime_content_type function, the locale information is set with the file asked by mime_content_type. Whe need to reset by setlocale() to retrieve the locale information what was before calling mime_content_type(). NB: same issue with finfo_file() Test script: --------------- setlocale(LC_ALL, 'fr_FR.UTF-8'); echo iconv("UTF-8", 'ASCII//TRANSLIT//IGNORE', 'bétâ'); // output : beta (OK) // $mime=mime_content_type('sheet.xls'); // sheet.xls is not a UTF8 file. echo iconv("UTF-8", 'ASCII//TRANSLIT//IGNORE', 'bétâ'); // output : b?t? (wrong) // $mime=mime_content_type('sheet.xls'); // sheet.xls is not a UTF8 file. setlocale(LC_ALL, 'fr_FR.UTF-8'); echo iconv("UTF-8", 'ASCII//TRANSLIT//IGNORE', 'bétâ'); // output : beta (OK)