public static string GetUtf32(string unicodeString) { var utf8 = new UTF32Encoding(); byte[] encodeBytes = utf8.GetBytes(unicodeString); string decodedString = utf8.GetString(encodeBytes); return decodedString; }
private string DecodeBase64String(string StrValue) { try { System.Text.UTF32Encoding objUTF32 = new System.Text.UTF32Encoding(); byte[] objbytes = Convert.FromBase64String(StrValue); return(objUTF32.GetString(objbytes)); } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "DecodeBase64String()", "CtlSettings.xaml.cs"); return(null); } }
private string DecodeBase64String(string StrValue) { try { System.Text.UTF32Encoding objUTF32 = new System.Text.UTF32Encoding(); byte[] objbytes = Convert.FromBase64String(StrValue); return objUTF32.GetString(objbytes); } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "DecodeBase64String()", "CtlSettings.xaml.cs"); return null; } }
/// <summary> /// Provides decoding functionality in UniversalString way for a string. /// </summary> /// <param name="bytes">A BER encoding result of UniversalString</param> /// <returns>The decoding result.</returns> private static string UniversalStringDecode(byte[] bytes) { if (bytes == null || bytes.Length % 4 != 0) { throw new Asn1DecodingUnexpectedData(ExceptionMessages.DecodingUnexpectedData); } UTF32Encoding be = new UTF32Encoding(true, false); return be.GetString(bytes); }