mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-28 11:54:57 +00:00
31 lines
813 B
C#
31 lines
813 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Crestron.SimplSharp;
|
|
|
|
namespace PepperDash.Core
|
|
{
|
|
/// <summary>
|
|
/// Represents a EncodingHelper
|
|
/// </summary>
|
|
public class EncodingHelper
|
|
{
|
|
/// <summary>
|
|
/// ConvertUtf8ToAscii method
|
|
/// </summary>
|
|
public static string ConvertUtf8ToAscii(string utf8String)
|
|
{
|
|
return Encoding.ASCII.GetString(Encoding.UTF8.GetBytes(utf8String), 0, utf8String.Length);
|
|
}
|
|
|
|
/// <summary>
|
|
/// ConvertUtf8ToUtf16 method
|
|
/// </summary>
|
|
public static string ConvertUtf8ToUtf16(string utf8String)
|
|
{
|
|
return Encoding.Unicode.GetString(Encoding.UTF8.GetBytes(utf8String), 0, utf8String.Length);
|
|
}
|
|
|
|
}
|
|
} |