This is an old revision of the document!
Version 1.0.0 (03.12.2014)
Diese Funktion wandelt alle mit Unicodes in einem String in Zeichen um.
Für die Ausgabe der Resultate verwendete ich die Funktion [VBA] print_r()
d unicodeDecode("abc\u0021 \u005C ") <String> 'abc! \ '
Attribute VB_Name = "udf_unicodeDecode" '------------------------------------------------------------------------------- 'File : udf_unicodeDecode.bas ' Copyright mpl by ERB software ' All rights reserved ' wiki.yaslaw.info/dokuwiki/doku.php/vba/functions/unicodedecode 'Environment : VBA 2007 + 'Version : 1.0.0 'Name : unicodeDecode 'Author : Stefan Erb (ERS) 'History : 03.12.2014 - ERS - Creation '------------------------------------------------------------------------------- Option Explicit '/** ' * Wandelt alle Unicodes in einem String in das eigentliche Zeichen zurück ' * @param String ' * @return String ' */ Public Function unicodeDecode(ByVal iString As String) As String Static rx As Object unicodeDecode = iString If rx Is Nothing Then Set rx = CreateObject("VBScript.RegExp"): rx.pattern = "\\u[0-9A-F]{4}" Do While rx.Test(unicodeDecode) unicodeDecode = rx.Replace(unicodeDecode, ChrW(Replace(rx.execute(unicodeDecode)(0), "\u", "&h"))) Loop End Function