惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
Last Week in AI
Last Week in AI
腾讯CDC
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
I
InfoQ
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
Y
Y Combinator Blog
H
Help Net Security
T
Tailwind CSS Blog
美团技术团队
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed

博客园 - №阿儒№

Inetinfo 进程 100%的解决方法 useless setTimeout call (missing quotes around argument?)解决方案 "invalid header field"解决方案 解决因为安装Lingoes 2.4后剪贴板无法正常工作的问题 FreeMarker学习 Extjs分页时遇上ivalid label的解决原理 UTF8与UTF8 without BOM之间的问题 - №阿儒№ [错误解决列表]解决异常信息 收集中 [bug]Upload Excel File时碰到的问题 [bug]解决因系统问题无法连接MQ reporting service学习-- 配置文件 [bug]访问ASP.NET临时文件夹的权限问题 如何解决FTP上传文件时出现的"Access is denied"错误? - №阿儒№ SQL Server 2005 Reporting Services 初次使用感受 [bug]Server Application Unavailable VS 中最简单的部署方式XCOPY Link Server的语法 [Bug]:创建虚拟目录出现别名已经存在的解决方案 将HTML中的内容存入WORD
解决WEB页的中英文显示问题
№阿儒№ · 2006-10-17 · via 博客园 - №阿儒№

WEB页的中英文显示解决方案之一:

        protected string EncodingCoverter(string text, int sourceCodePage, int targetCodePage)
        
{
            
// Gets the encoding for the specified code page.
            Encoding sourceEncoding = Encoding.GetEncoding(sourceCodePage);
            Encoding targetEncoding 
= Encoding.GetEncoding(targetCodePage);

            
return EncodingCoverter(text, sourceEncoding, targetEncoding);
        }


        
protected string EncodingCoverter(string text, Encoding sourceEncoding, Encoding targetEncoding)
        
{
            
// Gets the byte representation of the specified string.
            byte[] decodedChars = sourceEncoding.GetBytes(text);
            
string encodedString = targetEncoding.GetString(decodedChars);

            
return encodedString;
        }

                Encoding sourceEncoding = Encoding.GetEncoding(1252);
                Encoding targetEncoding 
= Encoding.GetEncoding(936);