Commit 32d827ac authored by Slava Monich's avatar Slava Monich

[mms-lib] KS_C_5601-1987 is known to g_convert as CP949

parent f946ef4e
/*
* Copyright (C) 2013-2014 Jolla Ltd.
* Copyright (C) 2013-2015 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
......@@ -516,7 +517,7 @@ mms_value_decode_encoded_text(
{ "ISO-8859-10", 13},
{ "Shift_JIS", 17},
{ "EUC-JP", 18},
{ "KS_C_5601-1987", 36},
{ "CP949", 36},
{ "ISO-2022-KR", 37},
{ "EUC-KR", 38},
{ "ISO-2022-JP", 39},
......
......@@ -126,7 +126,7 @@ static const struct {
{ 13, "ISO-8859-10" },
{ 17, "Shift_JIS" },
{ 18, "EUC-JP" },
{ 36, "KS_C_5601-1987" },
{ 36, "CP949" },
{ 37, "ISO-2022-KR" },
{ 38, "EUC-KR" },
{ 39, "ISO-2022-JP" },
......@@ -517,6 +517,8 @@ static char *decode_encoded_string_with_mib_enum(const unsigned char *p,
const char *to_codeset = "UTF-8";
gsize bytes_read;
gsize bytes_written;
char* converted;
GError *error = NULL;
if (wsp_decode_integer(p, l, &mib_enum, &consumed) == FALSE)
return NULL;
......@@ -533,9 +535,16 @@ static char *decode_encoded_string_with_mib_enum(const unsigned char *p,
if (from_codeset == NULL)
return NULL;
return g_convert((const char *) p + consumed, l - consumed,
converted = g_convert((const char *) p + consumed, l - consumed,
to_codeset, from_codeset,
&bytes_read, &bytes_written, NULL);
&bytes_read, &bytes_written, &error);
if (!converted) {
MMS_ERR("%s", MMS_ERRMSG(error));
g_error_free(error);
}
return converted;
}
static char* decode_encoded_text(enum wsp_value_type t,
......
/*
* Copyright (C) 2013-2014 Jolla Ltd.
* Copyright (C) 2013-2015 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
......@@ -67,6 +68,7 @@ int main(int argc, char* argv[])
"m-retrieve_7.conf",
"m-retrieve_8.conf",
"m-retrieve_9.conf",
"m-retrieve_10.conf",
"m-notifyresp.ind",
"m-read-rec.ind",
"m-send_1.req",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment