示例无效的 utf8 字符串? [英] Example invalid utf8 string?

查看:31
本文介绍了示例无效的 utf8 字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试我的一些代码如何处理错误数据,我需要一些无效的 UTF-8 字节序列.

I'm testing how some of my code handles bad data, and I need a few series of bytes that are invalid UTF-8.

你能发布一些,最好是解释它们为什么不好/你从哪里得到它们的解释吗?

Can you post some, and ideally, an explanation of why they are bad/where you got them?

推荐答案

看一看 Markus Kuhn 的 UTF-8 解码器能力和压力测试文件

您会发现许多 UTF-8 不规则的示例,包括单独的起始字节、缺少连续字节、超长序列等.

You'll find examples of many UTF-8 irregularities, including lonely start bytes, continuation bytes missing, overlong sequences, etc.

这篇关于示例无效的 utf8 字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆