broadband-modem: new method to convert from UTF-8 to the charset in the modem
This commit is contained in:
@@ -6413,6 +6413,17 @@ mm_broadband_modem_take_and_convert_to_utf8 (MMBroadbandModem *self,
|
||||
self->priv->modem_current_charset);
|
||||
}
|
||||
|
||||
gchar *
|
||||
mm_broadband_modem_take_and_convert_to_current_charset (MMBroadbandModem *self,
|
||||
gchar *str)
|
||||
{
|
||||
/* should only be used AFTER current charset is set */
|
||||
if (self->priv->modem_current_charset == MM_MODEM_CHARSET_UNKNOWN)
|
||||
return str;
|
||||
|
||||
return mm_utf8_take_and_convert_to_charset (str, self->priv->modem_current_charset);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMBroadbandModem *
|
||||
|
@@ -62,4 +62,10 @@ MMBroadbandModem *mm_broadband_modem_new (const gchar *device,
|
||||
gchar *mm_broadband_modem_take_and_convert_to_utf8 (MMBroadbandModem *self,
|
||||
gchar *str);
|
||||
|
||||
/* Convert the given string, which comes in UTF-8, to the charset currently set
|
||||
* in the modem. Given in the API so that subclasses can also use it directly.
|
||||
*/
|
||||
gchar *mm_broadband_modem_take_and_convert_to_current_charset (MMBroadbandModem *self,
|
||||
gchar *str);
|
||||
|
||||
#endif /* MM_BROADBAND_MODEM_H */
|
||||
|
Reference in New Issue
Block a user