[求助]用ASP怎么把日文字符放进MSSQL数据库不产生乱码??急~~~

LQliqing 2007-05-29 08:45:52
用ASP怎么把日文字符放进MSSQL数据库不产生乱码??急~~~
帮忙~~~
谢谢
...全文
186 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
yongfa365 2007-06-02
就这么结了?我还想看看哪位有更好的办法呢
回复
LQliqing 2007-06-02
..............还是结了吧~~~~~~
回复
LQliqing 2007-05-30
日文字符放进MSSQL数据库不产生乱码的问题解决了
----------------------------------------------------------
不要转换任何模块网页的编码该utf-8的还是utf-8,该Gb22312的还是Gb2312
在Utf-8模块的包文件(如conn.asp,但是要注意conn.asp必须是在第一行调用)最前面加上

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>
在GB2312模块的包文件最前面加上

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%Session.CodePage=936%>
--------------------------------------------------------
可是,我把数据库的数据显示出来的时候,又变成了乱码
当我使用utf-8,放入数据库的数据不是乱码,显示出来就变成了乱码
当我使用Gb2312,放入数据库的数据是乱码,这些数据显示出来也是乱码,不过,前面用utf-8插入的日文字符,显示出来的是正确的日文字符~~~~~~~`
server.encoding,这个东西该怎么用啊?
回复
yongfa365 2007-05-29
这个是Z-blog里的,可以改做成函数就可以用了
If ZC_JAPAN_TO_HTML And Instr(para,"[japan-html]")>0 Then
source=Replace(source,"ガ","ガ")
source=Replace(source,"ギ","ギ")
source=Replace(source,"ア","ア")
source=Replace(source,"ゲ","ゲ")
source=Replace(source,"ゴ","ゴ")
source=Replace(source,"ザ","ザ")
source=Replace(source,"ジ","ジ")
source=Replace(source,"ズ","ズ")
source=Replace(source,"ゼ","ゼ")
source=Replace(source,"ゾ","ゾ")
source=Replace(source,"ダ","ダ")
source=Replace(source,"ヂ","ヂ")
source=Replace(source,"ヅ","ヅ")
source=Replace(source,"デ","デ")
source=Replace(source,"ド","ド")
source=Replace(source,"バ","バ")
source=Replace(source,"パ","パ")
source=Replace(source,"ビ","ビ")
source=Replace(source,"ピ","ピ")
source=Replace(source,"ブ","ブ")
source=Replace(source,"ブ","ブ")
source=Replace(source,"プ","プ")
source=Replace(source,"ベ","ベ")
source=Replace(source,"ペ","ペ")
source=Replace(source,"ボ","ボ")
source=Replace(source,"ポ","ポ")
source=Replace(source,"ヴ","ヴ")
End If
If ZC_JAPAN_TO_HTML And Instr(para,"[html-japan]")>0 Then
source=Replace(source,"ガ","ガ")
source=Replace(source,"ギ","ギ")
source=Replace(source,"ア","ア")
source=Replace(source,"ゲ","ゲ")
source=Replace(source,"ゴ","ゴ")
source=Replace(source,"ザ","ザ")
source=Replace(source,"ジ","ジ")
source=Replace(source,"ズ","ズ")
source=Replace(source,"ゼ","ゼ")
source=Replace(source,"ゾ","ゾ")
source=Replace(source,"ダ","ダ")
source=Replace(source,"ヂ","ヂ")
source=Replace(source,"ヅ","ヅ")
source=Replace(source,"デ","デ")
source=Replace(source,"ド","ド")
source=Replace(source,"バ","バ")
source=Replace(source,"パ","パ")
source=Replace(source,"ビ","ビ")
source=Replace(source,"ピ","ピ")
source=Replace(source,"ブ","ブ")
source=Replace(source,"ブ","ブ")
source=Replace(source,"プ","プ")
source=Replace(source,"ベ","ベ")
source=Replace(source,"ペ","ペ")
source=Replace(source,"ボ","ボ")
source=Replace(source,"ポ","ポ")
source=Replace(source,"ヴ","ヴ")
End If
回复
yongfa365 2007-05-29
'把所有日文删除

Function filteJapanese(sStr)
Dim oRegExp
Set oRegExp = New RegExp
oRegExp.Global = True
oRegExp.Pattern = "[\u3040-\u309F\u30A0-\u30FF]"
filteJapanese = oRegExp.Replace(sStr, "")
Set oRegExp = Nothing
End Function
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2007-05-29 08:45
社区公告
暂无公告