summaryrefslogtreecommitdiff
path: root/db3x_autobackups/dbsettings.c
diff options
context:
space:
mode:
Diffstat (limited to 'db3x_autobackups/dbsettings.c')
-rw-r--r--db3x_autobackups/dbsettings.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/db3x_autobackups/dbsettings.c b/db3x_autobackups/dbsettings.c
index f5e6280..2f464f4 100644
--- a/db3x_autobackups/dbsettings.c
+++ b/db3x_autobackups/dbsettings.c
@@ -383,9 +383,17 @@ static int GetContactSetting(WPARAM wParam,LPARAM lParam)
return 1;
if ( dgs->pValue->type == DBVT_UTF8 ) {
- mir_utf8decode( dgs->pValue->pszVal, NULL );
- dgs->pValue->type = DBVT_ASCIIZ;
- }
+ WCHAR* tmp;
+ char* val = mir_utf8decode( dgs->pValue->pszVal, &tmp );
+ if ( val == NULL ) {
+ dgs->pValue->type = DBVT_WCHAR;
+ mir_free( dgs->pValue->pszVal );
+ dgs->pValue->pwszVal = tmp;
+ }
+ else {
+ dgs->pValue->type = DBVT_ASCIIZ;
+ mir_free( tmp );
+ } }
return 0;
}