1--TEST-- 2mb_detect_encoding() with incomplete trailing sequence 3--EXTENSIONS-- 4mbstring 5--FILE-- 6<?php 7 8// Even in non-strict mode, this should detect as ISO-8859-1. When the end of the string is 9// reached neither have illegal characters and would be picked based on score. However, flushing 10// the string will disqualify UTF-8 due to illegal characters. 11var_dump(mb_detect_encoding("A\xC2", ["UTF-8", "ISO-8859-1"])); 12 13?> 14--EXPECT-- 15string(10) "ISO-8859-1" 16