diff --git a/dev-tools/text-removal.sh b/dev-tools/text-removal.sh
new file mode 100755
index 0000000..7b4e863
--- /dev/null
+++ b/dev-tools/text-removal.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# Replace all occurences of TEXT() in our codebase
+# to convert it to simpler Unicode-only code.
+
+set -x
+
+sed -i -E \
+	-e 's/TEXT\(("[^"]*")\)/L\1/g' \
+	-e 's/TEXT\(([^)]*)\)/L\1/g' \
+        -e 's/_T\(/_L(/g' \
+	-e 's/" LPRIsLPTSTR L"/ls/g' \
+	-e 's/" LPRIsLPTSTR/ls"/g' \
+	-e 's/LPRIsLPTSTR L"/L"ls/g' \
+	-e 's/" LPRIsLPOLESTR L"/ls/g' \
+	-e 's/LPRIsLPOLESTR L"/L"ls/g' \
+	-e 's/" LPRIsLPOLESTR/ls"/g' \
+	-e 's/" PRIsLPTSTR "/ls/g' \
+	-e 's/" PRIsLPOLESTR "/ls/g' \
+	-e 's/TCHAR/WCHAR/g' \
+	-e 's/LPTSTR/LPWSTR/g' \
+	-e 's/LPCTSTR/LPCWSTR/g' \
+	-e 's/LPRIXGUID/_L(PRIXGUID)/g' \
+	-e 's/LTAP_WIN_COMPONENT_ID/_L(TAP_WIN_COMPONENT_ID)/g' \
+	-e 's/LPACKAGE_(VERSION|NAME)/_L(PACKAGE_\1)/g' \
+        -e 's/LPACKAGE /_L(PACKAGE) /g' \
+	-e 's/_tcslen/wcslen/g' \
+        -e 's/_tcszlen/wcszlen/g' \
+	-e 's/_tcsrchr/wcsrchr/g' \
+	-e 's/_tcschr/wcschr/g' \
+	-e 's/_tcsstr/wcsstr/g' \
+	-e 's/_tcszistr/wcszistr/g' \
+        -e 's/_tcscpy/wcscpy/g' \
+        -e 's/_tcsicmp/wcsicmp/g' \
+        -e 's/_tcsdup/wcsdup/g' \
+        -e 's/_istspace/iswspace/g' \
+        -e 's/_stprintf/swprintf/g' \
+        -e 's/_ftprintf/fwprintf/g' \
+        -e 's/_tmain/wmain/g' \
+        -e 's/tchar\.h/wchar.h/g' \
+	src/openvpnmsica/*.[ch] \
+        src/openvpnserv/*.[ch] \
+        src/tapctl/*.[ch]
+
+# manual cleanup for complicated cases
+sed -i -E \
+    -e 's/error 0x%x.\\n"\),/error 0x%x).\\n",/g' \
+    src/tapctl/main.c
+sed -i -E \
+    -e 's/" is optional\\n"\),/") is optional\\n",/g' \
+    src/openvpnserv/service.c
