/// <summary> /// Converts character to an ascii c like string representation. /// If unicode character is outside the range of an Ascii /// character then Convert.NonAsciiCharacter is returned. /// </summary> /// <param name="value">char to be converted</param> /// <returns></returns> public unsafe static CString8 *ToCString8(char value) { CString8 *str1 = CString8.Create(1); str1->SetChar(0, ToAscii(value)); return(str1); }
/// <summary> /// Converts string to its ascii representation terminating with /// null. If unicode character is outside the range of an Ascii /// character then Convert.NonAsciiCharacter is returned in its /// place. /// </summary> /// <param name="value"></param> /// <returns></returns> public unsafe static CString8 *ToCString8(string value) { CString8 *str1 = CString8.Create(value.Length); for (int x = 0; x < value.Length; x++) { str1->SetChar(x, ToAscii(value [x])); } return(str1); }