Posts

Showing posts with the label software development

Quick and Easy Way to Convert Unicode to ASCII (C#)

///   <summary> ///  Given a string, replaces UNICODE characters with ASCII characters ///   </summary> ///   <param name="s"> the string to be scrubbed of UNICODE characters </param> ///   <returns> a string with only ASCII characters </returns> ///   <code> ///  string myString = "BÌĹĹ GÓÓĎ"; ///  System.Console.WriteLine(" Converted string = " + Utilties. ConvertUnicodeToAsciiV2( myString)); ///   </code> public   static   string  ConvertUnicodeToAsciiV2( string  s) {      return   Encoding .ASCII.GetString( Encod ing .GetEncoding(437).GetBytes( s)); }