Some problems of addslashes

Source: Internet
Author: User

As for the wide-byte injection, someone wrote it, and I don't write more:

Https://www.91ri.org/8611.html

Http://netsecurity.51cto.com/art/201404/435379_4.htm

For the Iconv () function, I tried to write a URL-encoding conversion for UTF-8 and GBK

Import os,urllibprint "" "If u want change gbk to utf-8,please input  gbk,so as input utf-8.input exit and exit,others make u try  agin "" "St = raw_input () DEF UTF8CWGBK (ST):     if st==" Utf-8 ":         print  "Input string"          url1 = raw_input ()         st1 =  Urllib.unquote (URL1)         st2 = st1.decode ("Utf-8"). Encode ("GBK")         url2 = urllib.quote (ST2)          print  "" "Utf-8 URL encoding---GBK URL encoding---utf-8 Kanji---gbk kanji" ""          PRINT URL1, '---', url2, '---', st1, '---',st2         os.system ('Pause ')     if st== "GBK":        print  " Input string "        url1 = raw_input ()          st1 = urllib.unquote (URL1)          st2 = st1.decode ("GBK"). Encode ("Utf-8")          Url2 = urllib.quote (ST2)         print  "" " Utf-8 URL encoding---GBK URL encoding---utf-8 Kanji---gbk kanji "" "        PRINT URL1, '---', url2, '---', st2, '---', st1        os.system (' pause ')      if st== "Exit":         os.system (' exit ')      else:        print "" "Please try again.if u  want change gbk To utf-8,please input gbk,else input utf8,finally input exit "" "         st = raw_input ()          UTF8CWGBK (ST) if __name__== "__main__":     UTF8CWGBK (ST)


This article is from the "Saluteiceman" blog, make sure to keep this source http://maxvision.blog.51cto.com/6269192/1686625

Some problems of addslashes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.