Public Function XUTF8_Decode(ByVal pStr As String) As String
Dim Buffer As String
Dim i As Integer
Dim vChar() As Char = pStr.ToCharArray()
Dim vutf8data(vChar.Length) As Byte
'vutf8data = Encoding.UTF8.GetBytes(pStr)
For i = 0 To (vChar.Length - 1)
vutf8data(i) = System.Convert.ToByte(vChar(i))
Next
Buffer = Encoding.UTF8.GetString(vutf8data)
'Return .
XUTF8_Decode = Buffer
End Function
Public Function XUTF8_Encode(ByVal pStr As String) As String
Dim vutf8Encoding As New System.Text.UTF8Encoding
Dim vencodedString() As Byte
Dim vStringRes As String
vencodedString = vutf8Encoding.GetBytes(pStr)
vStringRes = vutf8Encoding.GetString(vencodedString)
'Return
XUTF8_Encode = vStringRes
End Function
Un poco de C#,JScript,VB, y CRM, Drupal, SQL , MSDCRM y MSDSL VBTools, developer, project lider, Social Media Activist, BlackBerry developer, telerik tools. (MCITP)
martes, 6 de enero de 2015
UTF8 encode and decode VB.Net
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario