search

Home  >  Q&A  >  body text

When IE browser form is submitted, Chinese transcoding is always invalid

1499653084528884.jpg

Ask the master.

This is the page where PHP submits the form. The receiver requires GBK encoding. The submitter's PHP and database are both in UTF-8 format. Therefore, the page is set up in the middle, and the encoding of the form is gbk.

After testing Google, Firefox, and the speed mode of domestic browsers, there is no problem, and the submitted name can be displayed normally.

Only IE browser and domestic browser's compatibility mode submission used to display garbled characters.

456.jpg

After packet capture, we found the following:

name=%E7%B4%A7%E7%8B%82%E7%A0%82

This piece of information is displayed in the packet capture. After verification, this is the transcoding in uft-8 mode. correct. But a problem arises. My page is in gbk. Why does the transcoding become utf-8 mode.

Now that I have finished describing the problem, I would like to ask the experts for help. Thanks

phpcn_u9994phpcn_u99942727 days ago1465

reply all(3)I'll reply

  • phpcn_u9994

    phpcn_u99942017-07-11 00:30:01

    Resolved

    reply
    0
  • PHP中文网

    PHP中文网2017-07-10 11:53:41

    onsubmit="document.charset='gbk';"

    I have never seen this kind of transcoding when submitting. The encoding should be processed on the receiving server side. Or the two codes are unified.

    reply
    0
  • PHP中文网

    PHP中文网2017-07-10 11:50:13

    Use

    @iconv('utf-8','gbk',$str);

    to try manual conversion coding, I wish you good luck.

    reply
    0
  • Cancelreply