原文发布时间为:2012-02-17 —— 来源于本人的百度文章 [由搬家工具导入]

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using  System.Globalization;

 static string RemoveDiacritics(string stIn) {
  string stFormD = stIn.Normalize(NormalizationForm.FormD);
  StringBuilder sb = new StringBuilder();

  for(int ich = 0; ich < stFormD.Length; ich++) {
    UnicodeCategory uc = CharUnicodeInfo.GetUnicodeCategory(stFormD[ich]);
    if(uc != UnicodeCategory.NonSpacingMark) {
      sb.Append(stFormD[ich]);
    }
  }
  return(sb.ToString().Normalize(NormalizationForm.FormC));

Replacing Accented characters(Diacritic) .NET的更多相关文章

  1. 关于header跳转之后的乱码

    http://www.360doc.com/content/11/0603/19/7052474_121495648.shtml 问题:不同网站的跳转出现乱码,不同编码的页面传递参数也出现乱码 搞清楚 ...

  2. escape(), encodeURI()和encodeURIComponent()(转)

      escape(), encodeURI()和encodeURIComponent()是在Javascript中用于编码字符串的三个常用的方法,而他们之间的异同却困扰了很多的Javascript初学 ...

  3. Total Commander 8.52 Beta 1

    Total Commander 8.52 Beta 1http://www.ghisler.com/852_b1.php 10.08.15 Release Total Commander 8.52 b ...

  4. JS URL传中文参数引发的乱码问题

    今天的项目中碰到了一个乱码问题,从JS里传URL到服务器,URL中有中文参数,服务器里读出的中文参数来的全是“?”,查了网上JS编码相关资料得以解决. 解决方法一: 1.在JS里对中文参数进行两次转码 ...

  5. 关于header跳转之后的乱码问题

    关于header跳转之后的乱码问题 http://www.360doc.com/content/11/0603/19/7052474_121495648.shtml 问题:不同网站的跳转出现乱码,不同 ...

  6. 比较escape、encodeURI、encodeURIComponent

    估计很多前端工程师并不清楚escape,encodeURI, encodeURIComponent的区别,也不知道什么时候该用哪个方法,以及这些方法为什么要被用到,下面我主要来阐述一下这三个方法的区别 ...

  7. 关于JavaScript中的escape、encodeURI和encodeURIComponent

    此文内容与关于JavaScript中的编码和解码函数 关联 escape() 方法: 采用ISO Latin字符集对指定的字符串进行编码.所有的空格符.标点符号.特殊字符以及其他非ASCII字符都将被 ...

  8. 学习笔记:The Best of MySQL Forum

    http://mysql.rjweb.org/bestof.html I have tagged many of the better forum threads. 'Better' is based ...

  9. 关于COM的Unicode string的精彩论述

    I need to make a detour for a few moments, and discuss how to handle strings in COM code. If you are ...

随机推荐

  1. PAM认证机制

    PAM:Pluggable Authentication Modules 认证库:文本文件,MySQL,NIS,LDAP等 Sun公司于1995 年开发的一种与认证相关的通用框架机制 PAM 是关注如 ...

  2. Apache 配置默认编码

    找到apache配置文件 httpd.conf ,找到以下内容 # # Specify a default charset for all content served; this enables # ...

  3. 一、Linux 安装

    Linux 安装 本章节我们将为大家介绍Linux的安装. 本章节以 centos6.4 为例. centos 下载地址: 可以去官网下载最新版本:https://www.centos.org/dow ...

  4. Firebase Cloud Function 编写与部署

    1.设置和初始化 Firebase SDK for Cloud Functions (1).Cloud Functions 运行的是 Node v6.14.0,因此需要安装nodejs: https: ...

  5. 12.1.VUE学习之-循环li,if判断示例讲解class中应用表达式

    功能: 当点击按键时,改变当前循环数组里的status里的值, 判断staus里的当前的值来,切换显示 删除 和 恢复 的按钮 判断staus里的当前的值来改变span标签里的字体颜色样式 <! ...

  6. 一个手机号可以注册绑定5个百度网盘,永久2T

    效果: 一个手机号可以注册绑定5个百度网盘,得永久2T硬盘 手机号只能做为其中一个网盘的登陆账号,其它四个用绑定qq登陆(微信应该也可以). 条件: 2个手机号:A(用来绑定百度网盘),B(用来申请网 ...

  7. POJ 2586 贪心+枚举

    Y2K Accounting Bug Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 15626   Accepted: 78 ...

  8. linux centos6 系统优化脚本-经典

    转载一篇Ricky的系统优化脚本,这个脚本只能针对centos6x 其他还没有测试,但centos7肯定不行的 #!/bin/bash # ID 201510192126 # Author Ricky ...

  9. Maya材质

    mental ray--Indirect Lighting(物理学太阳天空)      Final Gathering最终聚集   改变质量为production的,FG就是关闭需要重新打开 平行光, ...

  10. 手机端sticker布局,底部按钮在屏幕底部

    <template> <div class="product-detail-container"> <div class="detail&q ...