提交 024799ac 编写于 作者: A Alexey Milovidov

Fixed error in Poco::UTF8Encoding::isLegal function [#METR-23332].

上级 ebbe877a
......@@ -224,23 +224,23 @@ bool UTF8Encoding::isLegal(const unsigned char *bytes, int length)
case 3:
if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
case 2:
if ((a = (*--srcptr)) > 0xBF) return false;
switch (*bytes)
a = (*--srcptr);
switch (*bytes)
{
case 0xE0:
if (a < 0xA0) return false;
if (a < 0xA0 || a > 0xBF) return false;
break;
case 0xED:
if (a > 0x9F) return false;
if (a < 0x80 || a > 0x9F) return false;
break;
case 0xF0:
if (a < 0x90) return false;
if (a < 0x90 || a > 0xBF) return false;
break;
case 0xF4:
if (a > 0x8F) return false;
if (a < 0x80 || a > 0x8F) return false;
break;
default:
if (a < 0x80) return false;
if (a < 0x80 || a > 0xBF) return false;
}
case 1:
if (*bytes >= 0x80 && *bytes < 0xC2) return false;
......
{
"meta":
[
{
"name": "s",
"type": "String"
}
],
"data":
[
["� �"]
],
"rows": 1
}
SET output_format_write_statistics = 0;
SELECT '\xED\x20\xA8' AS s FORMAT JSONCompact;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册