cdeb 3 Posted July 12, 2019 I have to convert strings with special characters to unicode escape sequences, how can I do? Example: input: questa è una provaoutput: questa \u00e8 una prova Share this post Link to post Share on other sites
Danp2 943 Posted July 12, 2019 Try searching the forum for "alnum". That should give you multiple threads to review. [UDF] WebDriver Latest version Wiki FAQs Share this post Link to post Share on other sites
Malkey 231 Posted July 14, 2019 Try this. Local $sInput = "questa è una prova" Local $sOutput = Execute(StringRegExpReplace($sInput, '(.)', '(AscW("$1")>127?"\\u"&StringLower(Hex(AscW("$1"),4)):"$1")&') & "''") MsgBox(0, "Result", "input: " & $sInput & @CRLF & "output: " & $sOutput & @CRLF) 3 1 pixelsearch, FrancescoDiMuro, Earthshine and 1 other reacted to this Share this post Link to post Share on other sites
pixelsearch 261 Posted July 15, 2019 (edited) Hi all, Thanks Malkey for the interesting solution using SRER. It took me a moment to understand the end of your $Output line ==> &') & "''") <== so I would like to share its meaning with our readers Malkey used an interesting Replace pattern, based on the Ternary function, as shown in this image : Each ampersand (&) is literally included in the updated string resulting from SRER, between the Ternary functions. As there is a final ampersand (circled in red), that's why he added "''" at the end of the string, so the Execute function won't generate an error when executed. Well done ! Edited July 15, 2019 by pixelsearch 1 FrancescoDiMuro reacted to this Share this post Link to post Share on other sites
cdeb 3 Posted July 17, 2019 Perfect! thank you very much Malkey Share this post Link to post Share on other sites