Tag: UTF-8预览模式: 普通 | 列表

ASP 写入 UTF-8 BOM 签名

使用 ASP 导出 CSV 文件,ASP 采用 UTF-8 编码,而生成的 CSV 文件因为没有包含 BOM 签名而不被 Excel 2003 识别,因此显示乱码。

BOM 签名为 0xEF 0xBB 0xBF 三个字节,使用 ASP 输出方法如下:
Response.BinaryWrite(chrb(239))
Response.BinaryWrite(chrb(187))
Response.BinaryWrite(chrb(191))


按此可解决 CSV 文件在 Excel 2003 出现乱码的问题。

查看更多...

Tags: ASP csv UTF-8 编码 乱码 Excel

分类:Coding | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 7431
setting @codepage explicitly affects literal strings in a single response. response.codepage affects dynamic strings in a single response, and session.codepage affects dynamic strings in all responses in a session.

查看更多...

Tags: ASP 编码 乱码 UTF-8

分类:WebBuild | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 6306