aBit

阿比特

  博客园 :: 首页 :: 联系 :: 订阅 订阅 :: 管理
  2 Posts :: 13 Stories :: 3 Comments :: 0 Trackbacks

公告

Fix the confused code problem

Problem 1): data have confused code.
Analysis: 用户输入“繁体”字符,以“西欧”(char NOT nchar)保存在数据库中
Solution:
1) <globalization requestEncoding="utf-8" responseEncoding="iso-8859-1" /> in Web.config
2) Response.Charset = "big5" in PageBase.vb

Problem 2): ListBox / DropDownList have confused code.
Analysis: 用户输入“简体”字符,以“西欧”(char NOT nchar)保存在数据库中
Solution:
        CodePage = 936
        For Each row As DataRow In DS.Tables(0).Rows
            Dim value As String = CStr(row("value"))
            row("value") = aBitCode.Common.Utility.ConvertEncode(value, "E", "C")
        Next

posted on 2006-03-15 16:26 aBit 阅读(40) 评论(0) 编辑 收藏