Solution to garbled Chinese Characters in files uploaded by FCKeditor under Asp.net

Source: Internet
Author: User

I used FCKeditor to upload files normally all the time, but later I modified the fck core and added the information about the uploaded files to the database after the upload was successful.

I found that the file with the Chinese file name was not uploaded normally (occasionally failed). Later I found that it was caused by Chinese garbled characters (Chinese garbled characters were found before, but not affected by the file suffix)

When talking about Chinese garbled characters, it must first be caused by encoding problems.

So starting from the encoding conversion, tried to convert the UTF-8 to gb2312, but found no way to convert success anyway

I have seen many articles about modifying the configuration file.

<Globalization requestencoding = "UTF-8" responseencoding = "UTF-8"/> This is quite easy, but other pages are messy, because other pages are based on gb2312

Here, a sudden flash of light is shining. Because my fck is a separate directory, I specify a dedicated web for this directory. config, It is not complete to specify the Encoding As UTF-8. A try is really effective, and the structure is simple!

To share with you.

The following shows all the contents of a relatively clean web. config:

 

Web. config

<? XML version = "1.0" encoding = "UTF-8"?>
<Configuration>

<System. Web>

<Compilation defaultlanguage = "C #" DEBUG = "true"/>

<Authorization>
<Allow users = "*"/>
</Authorization>

<Trace enabled = "false" requestlimit = "10" pageoutput = "false" tracemode = "sortbytime" localonly = "true"/>

<Customerrors mode = "off"/>

<Globalization requestencoding = "UTF-8" responseencoding = "UTF-8" fileencoding = "UTF-8"/>

<Pages validaterequest = "false" enableeventvalidation = "false" enableviewstatemac = "false" viewstateencryptionmode = "never"/>

<Xhtmlconformance mode = "Legacy"/>

<Httpruntime maxrequestlength = "2097151" executiontimeout = "3600"/>
</System. Web>

</Configuration>

 

 

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.