summaryrefslogtreecommitdiff
path: root/plugins/IEView/src/Utils.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-03-16 11:50:58 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-03-16 11:50:58 +0000
commita1a305735072f66fc48de018d187ded085ecf89b (patch)
tree269b620466453a480d732bdff4eda68fdf84eab1 /plugins/IEView/src/Utils.cpp
parent2a1cd0326fa6a54d7cfee9187fbe4f7849c55620 (diff)
own UTF8Encode removed. now use core encoding.
git-svn-id: http://svn.miranda-ng.org/main/trunk@4064 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src/Utils.cpp')
-rw-r--r--plugins/IEView/src/Utils.cpp60
1 files changed, 2 insertions, 58 deletions
diff --git a/plugins/IEView/src/Utils.cpp b/plugins/IEView/src/Utils.cpp
index d9a3f85043..ab30e81e72 100644
--- a/plugins/IEView/src/Utils.cpp
+++ b/plugins/IEView/src/Utils.cpp
@@ -229,62 +229,6 @@ DWORD Utils::safe_wcslen(wchar_t *msg, DWORD maxLen) {
return 0;
}
-char * Utils::UTF8Encode(const wchar_t *wtext) {
- unsigned char *szOut;
- int len, i;
- const wchar_t *w;
-
- if (wtext == NULL) return NULL;
- for (len=0, w=wtext; *w; w++) {
- if (*w < 0x0080) len++;
- else if (*w < 0x0800) len += 2;
- else len += 3;
- }
- szOut = new unsigned char [len+1];
- if (szOut == NULL) return NULL;
-
- for (i=0, w=wtext; *w; w++) {
- if (*w < 0x0080)
- szOut[i++] = (unsigned char) *w;
- else if (*w < 0x0800) {
- szOut[i++] = 0xc0 | ((*w) >> 6);
- szOut[i++] = 0x80 | ((*w) & 0x3f);
- }
- else {
- szOut[i++] = 0xe0 | ((*w) >> 12);
- szOut[i++] = 0x80 | (((*w) >> 6) & 0x3f);
- szOut[i++] = 0x80 | ((*w) & 0x3f);
- }
- }
- szOut[i] = '\0';
- return (char *) szOut;
-}
-
-char *Utils::UTF8Encode(const char *text) {
- wchar_t *wtext = Utils::convertToWCS(text);
- char *atext = UTF8Encode(wtext);
- delete wtext;
- return atext;
-}
-
-void Utils::UTF8Encode(const char *text, char *output, int maxLen) {
- wchar_t *wtext = Utils::convertToWCS(text);
- char *atext = UTF8Encode(wtext);
- int slen = (int)strlen(atext) + 1;
- memcpy(output, atext, slen > maxLen ? maxLen : slen);
- output[maxLen - 1] = '\0';
- delete atext;
- delete wtext;
-}
-
-void Utils::UTF8Encode(const wchar_t *wtext, char *output, int maxLen) {
- char *atext = UTF8Encode(wtext);
- int slen = (int)strlen(atext) + 1;
- memcpy(output, atext, slen > maxLen ? maxLen : slen);
- output[maxLen - 1] = '\0';
- delete atext;
-}
-
int Utils::detectURL(const wchar_t *text) {
int i;
for (i=0;text[i]!='\0';i++) {
@@ -401,9 +345,9 @@ void Utils::destroyServices_Ex() {
}
wchar_t *Utils::urlEncode(const wchar_t *text) {
- char *utf8 = UTF8Encode(text);
+ char *utf8 = mir_utf8encodeT(text);
wchar_t *result = urlEncode(utf8);
- delete utf8;
+ mir_free(utf8);
return result;
}