\ x1a字符是什么意思 [英] What does the \x1a characters mean

查看:311
本文介绍了\ x1a字符是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

\x1a字符是什么意思,为什么mysql_real_escape_string会转义它?

What does the \x1a character mean and why does mysql_real_escape_string escape it?

从文档中:

mysql_real_escape_string()调用MySQL的库函数mysql_real_escape_string,该函数将反斜杠添加到以下字符前:\ x00,\ n,\ r,\,','和\ x1a.

mysql_real_escape_string() calls MySQL's library function mysql_real_escape_string, which prepends backslashes to the following characters: \x00, \n, \r, \, ', " and \x1a.

ASCII字符参考将其描述为Substitute character,但这并不多.

A ASCII Characters reference describes it as Substitute character, but this doesn't say much.

推荐答案

这是Unicode 转义序列,以十六进制(基数16). \x1a替代"字符.

It's a Unicode escape sequence, in hexadecimal (base 16). \x1a is the "substitute" character.

另请参阅: http://en.wikipedia.org/wiki/Substitute_character


See also: http://en.wikipedia.org/wiki/Substitute_character

为什么mysql_real_escape_string逃脱了它?

根据文档,

严格来说,MySQL仅要求转义反斜杠和用于对查询中的字符串加引号的引号字符. mysql_real_escape_string()引用其他字符以使它们更易于在日志文件中阅读.

Strictly speaking, MySQL requires only that backslash and the quote character used to quote the string in the query be escaped. mysql_real_escape_string() quotes the other characters to make them easier to read in log files.

这篇关于\ x1a字符是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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