What does the \x1a characters mean

前端 未结 5 821
庸人自扰
庸人自扰 2021-02-19 08:36

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

From the documentation:

mysql_real_e

相关标签:
5条回答
  • 2021-02-19 08:42

    \x1a is a SUB control character, used to mark end of a file (EOF).

    0 讨论(0)
  • 2021-02-19 08:44

    This is is because of an empty line et the eof file the program try to read the values in the empty line and read \x1a

    0 讨论(0)
  • 2021-02-19 08:50

    \x1A is CTRL+Z control character. It is also EOF marker.

    0 讨论(0)
  • 2021-02-19 08:51

    It is a hexadecimal escape sequence for the SUB character.

    0 讨论(0)
  • 2021-02-19 08:57

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

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


    Why does mysql_real_escape_string escape it?

    According to the documentation,

    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.

    0 讨论(0)
提交回复
热议问题