summaryrefslogtreecommitdiff
path: root/updater/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'updater/utils.cpp')
-rw-r--r--updater/utils.cpp52
1 files changed, 5 insertions, 47 deletions
diff --git a/updater/utils.cpp b/updater/utils.cpp
index 5be5897..daed5a8 100644
--- a/updater/utils.cpp
+++ b/updater/utils.cpp
@@ -94,53 +94,11 @@ bool CreatePath(const TCHAR *path) {
*/
}
-// must 'free' return val
-TCHAR *GetTString(const char *asc) {
- if(!asc) return 0;
-
-#ifdef _UNICODE
- wchar_t *ret;
- int code_page = CP_ACP;
- if(ServiceExists(MS_LANGPACK_GETCODEPAGE)) code_page = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
- int size = MultiByteToWideChar(code_page, MB_PRECOMPOSED, asc, -1, 0, 0);
- ret = (wchar_t *)malloc(sizeof(wchar_t) * size);
- MultiByteToWideChar(code_page, MB_PRECOMPOSED, asc, -1, ret, size);
- return ret;
-#else
- return _strdup(asc);
-#endif
-}
-
-TCHAR *GetTStringACP(const char *asc) {
- if(!asc) return 0;
-
-#ifdef _UNICODE
- wchar_t *ret;
-
- int size = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, asc, -1, 0, 0);
- ret = (wchar_t *)malloc(sizeof(wchar_t) * size);
- MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, asc, -1, ret, size);
- return ret;
-#else
- return _strdup(asc);
-#endif
-}
-
-char *GetAString(const TCHAR *t) {
- if(!t) return 0;
-
-#ifdef _UNICODE
- char *ret;
-
- int code_page = CP_ACP;
- if(ServiceExists(MS_LANGPACK_GETCODEPAGE)) code_page = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
- int size = WideCharToMultiByte(code_page, 0, t, -1, 0, 0, 0, 0);
- ret = (char *)malloc(size);
- WideCharToMultiByte(code_page, 0, t, -1, ret, size, 0, 0);
- return ret;
-#else
- return _strdup(t);
-#endif
+// must 'mir_free' return val
+TCHAR *GetTString(const char *asc)
+{
+ if (!asc) return NULL;
+ return (TCHAR*)CallService(MS_LANGPACK_PCHARTOTCHAR, 0, (LPARAM)asc);
}
void RemoveFolder(const TCHAR *src_folder) {