Converts the String to UTF8 Byte array and is used in Deserialization - CSharp System

CSharp examples for System:String Unicode

Description

Converts the String to UTF8 Byte array and is used in Deserialization

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from  w  w w. ja va2s .  c o  m

public class Main{
        /// <summary>
        /// Converts the String to UTF8 Byte array and is used in De serialization
        /// </summary>
        /// <param name="pXmlString"></param>
        /// <returns></returns>
        static public Byte[] StringToUTF8ByteArray(String pXmlString)
        {
            UTF8Encoding encoding = new UTF8Encoding();
            Byte[] byteArray = encoding.GetBytes(pXmlString);
            return byteArray;
        }
}

Related Tutorials