UTF8R_toChar

Converts characters created by program R into actual chars
as in < U+641 > to Faa' letter in Arabic

Function UTF8R_toChar(UTF8R)
 ' Converts a UTF8 code generated by applications like R program into its actual char
 ' Example < U+641 > to Faa' letter in Arabic
 NewCod = UTF8R
 If Left(UCase(NewCod), 3) = Chr(60) & "U+" Then NewCod = Mid(NewCod, 4)
 If Left(UCase(NewCod), 2) = Chr(60) & "U" Then NewCod = Mid(NewCod, 3)
 If Left(UTF8R, 1) = "<" Then NewCod = Mid(NewCod, 2)
 If Right(UTF8R, 1) = ">" Then NewCod = Left(NewCod, Len(NewCod) - 1)
 UTF8R_toChar = ChrW(Val("&H" & NewCod))
End Function

UTF8R

Views 2411 Downloads 856


ANmarAmdeen
592
Texts + Strings Classic ASP
Revisions

v1.0