標籤:
提到中文亂碼,首先肯定是由於編碼問題引起的所以就從編碼轉換入手,嘗試了將UTF-8轉換為GB2312,但發現無論如何沒有辦法轉成功
看到很多文章說修改設定檔
<globalization requestEncoding="UTF-8" responseEncoding="UTF-8"/>這樣是挺Easy的,但是其他頁面就是亂套,因為是其他頁面都是基於GB2312的
這裡突然靈光一閃,由於我的FCK是單獨是一個目錄的,我給這個目錄指定一個專用的web.config,指定編碼為utf-8不就完整了嘛,一試果然有效,這裡在fck目錄內添加設定檔就可以了。測試通過了
<?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>
C# 使用 fckeditor 上傳檔案中文名亂碼的問題---轉