mirror of
https://github.com/php/php-src.git
synced 2024-11-30 21:35:36 +08:00
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fix #75944: Wrong cp1251 detection
This commit is contained in:
commit
cd2912af5e
3
NEWS
3
NEWS
@ -2,6 +2,9 @@ PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2018, PHP 7.2.5
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #75944 (Wrong cp1251 detection). (dmk001)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #76088 (ODBC functions are not available by default on Windows).
|
||||
(cmb)
|
||||
|
@ -142,7 +142,7 @@ mbfl_filt_conv_wchar_cp1251(int c, mbfl_convert_filter *filter)
|
||||
/* all of this is so ugly now! */
|
||||
static int mbfl_filt_ident_cp1251(int c, mbfl_identify_filter *filter)
|
||||
{
|
||||
if (c >= 0x80 && c < 0xff)
|
||||
if (c >= 0x80 && c <= 0xff)
|
||||
filter->flag = 0;
|
||||
else
|
||||
filter->flag = 1; /* not it */
|
||||
|
13
ext/mbstring/tests/bug75944.phpt
Normal file
13
ext/mbstring/tests/bug75944.phpt
Normal file
@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #75944 (wrong detection cp1251 encoding because of missing last cyrillic letter)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(mb_detect_encoding(chr(0xfe), array('CP-1251'))); // letter '?'
|
||||
var_dump(mb_detect_encoding(chr(0xff), array('CP-1251'))); // letter '?'
|
||||
?>
|
||||
--EXPECT--
|
||||
string(12) "Windows-1251"
|
||||
string(12) "Windows-1251"
|
||||
|
Loading…
Reference in New Issue
Block a user