Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Internationalization / September 2007

Tip: Looking for answers? Try searching our database.

Removing diacritics

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jan Kucera - 13 Sep 2007 12:29 GMT
Hi,
is there any other way to remove diacritics in .NET, than

StringBuilder normalized = new
StringBuilder("aáůř".Normalize(NormalizationForm.FormD));
for (int i = 0; i < normalized.Length; i++)
   if (char.GetUnicodeCategory(normalized[i]) ==
UnicodeCategory.NonSpacingMark)
   {
       normalized.Remove(i, 1);
       i--;
   }

?

Jan
Michael S. Kaplan [MSFT] - 14 Sep 2007 08:09 GMT
Well, get the improved code from here:

http://blogs.msdn.com/michkap/archive/2005/02/19/376617.aspx

and note that I point out the semantic flaw here:

http://blogs.msdn.com/michkap/archive/2007/09/04/4734456.aspx

After I finish the current series on sort keys I'll be posting some solution
ideas to the problem raised there.

There is no other way in the framework though, sorry.

Signature

MichKa [Microsoft]
Fundamentals Technical Lead
Windows International
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with
no warranties, and confers no rights.

> Hi,
> is there any other way to remove diacritics in .NET, than
[quoted text clipped - 12 lines]
>
> Jan
Jan Kucera - 14 Sep 2007 09:09 GMT
Hmm... I should begin to count with that every question I ask, you have
already answered. That way I maybe won't feel so reckless. :-)
And thanks, not only for your patience. :)

Pity there is no "ignore diacritics" flag in RegularExpression settings.

Looking forward to your post, and enjoying the sort keys series!
Jan

> Well, get the improved code from here:
>
[quoted text clipped - 25 lines]
>>
>> Jan

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.