Char to utf code in vbscript

I would like to create a .properties file that will be used in a Java program from VBScript. I am going to use some lines in languages ​​that use characters outside the ASCII map. Therefore, I need to replace these characters with UTF code. That would be for a, \ u0062 for b, etc.

Is there a way to get the UTF code for char in VBScript?

+3
source share
1 answer

VBScript has a function AscWthat returns the Unicode (wide) code of the first character in the specified string.

, AscW , , , ( , VBScript ). , , \unnnn, ​​:

WScript.Echo ToUnicodeChar("✈") ''# \u2708

Function ToUnicodeChar(Char)
  str = Hex(AscW(Char))
  ToUnicodeChar = "\u" & String(4 - Len(str), "0") & str 
End Function
+4

Source: https://habr.com/ru/post/1732269/


All Articles