Пример #1
0
        /// <summary>
        /// Get the standard name for an encoding converter, accoding to some standard.
        /// </summary>
        /// <param name="name">The canonical name of the converter</param>
        /// <param name="standard">The name of the standard, e.g. "IANA"</param>
        /// <returns>The name as a string, or <c>null</c> if no name could be determined.</returns>
        public static string GetStandardName(string name, string standard)
        {
            var resultPtr = NativeMethods.ucnv_getStandardName(name, standard, out var status);

            ExceptionFromErrorCode.ThrowIfError(status);
            return(resultPtr == IntPtr.Zero ? null : Marshal.PtrToStringAnsi(resultPtr));
        }