特殊字符转义
void String::print(String *str) { char *st= (char*)Ptr, *end= st+str_length; for (; st < end; st++) { uchar c= *st; switch (c) { case '\\': str->append(STRING_WITH_LEN("\\\\")); break; case '\0': str->append(STRING_WITH_LEN("\\0")); break; case '\'': str->append(STRING_WITH_LEN("\\'")); break; case '\n': str->append(STRING_WITH_LEN("\\n")); break; case '\r': str->append(STRING_WITH_LEN("\\r")); break; case '\032': // Ctrl-Z str->append(STRING_WITH_LEN("\\Z")); break; default: str->append(c); } } }
MySQL限时解答,24小时内友哥专业解答
http://www.yougemysqldba.com
如有进一步需要请联系微信onesoft007
微博账号@友哥一指
http://www.yougemysqldba.com
如有进一步需要请联系微信onesoft007
微博账号@友哥一指