Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用AutoIt将Unicode字符转换为ANSI?_Java_Autoit - Fatal编程技术网

Java 如何使用AutoIt将Unicode字符转换为ANSI?

Java 如何使用AutoIt将Unicode字符转换为ANSI?,java,autoit,Java,Autoit,我正在阅读一个带有AutoIt的Java属性文件,其中包含一些\u0xxx格式的unicode字符 如何使用AutoIt将其转换为ANSI?感谢所有帮助: 这就是解决方案: #include <WinAPI.au3> Local $str = "My name is \u0393\u03A1\u0397" Local $utfStr = Execute("'" & StringRegExpReplace($str, "(\\u([[:xdigit:]]{4}))","' &

我正在阅读一个带有AutoIt的Java属性文件,其中包含一些
\u0xxx
格式的unicode字符


如何使用AutoIt将其转换为ANSI?

感谢所有帮助:

这就是解决方案:

#include <WinAPI.au3>

Local $str = "My name is \u0393\u03A1\u0397"
Local $utfStr = Execute("'" & StringRegExpReplace($str, "(\\u([[:xdigit:]]{4}))","' & ChrW(0x$2) & '") & "'")
Local $ansiStr = _WinAPI_WideCharToMultiByte($utfStr)
MsgBox(64,"Unicode2Ansi", $utfStr & @CRLF & $ansiStr)

Exit
#包括
Local$str=“我的名字是\u0393\u03A1\u0397”
本地$utfStr=Execute(“'”&StringRegExpReplace($str,“(\\u([:xdigit:]{4}))”,“'&ChrW(0x$2)&'”和“”)
本地$ansiStr=\u WinAPI\u WideCharttoMultiByte($utfStr)
MsgBox(64,“Unicode2Ansi”、$utfStr&@CRLF&$ansiStr)
出口