Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: Add support for SMS national language identifiers
Date: Fri, 04 Sep 2009 11:21:20 -0500	[thread overview]
Message-ID: <200909041121.21109.denkenz@gmail.com> (raw)
In-Reply-To: <a32762a20909040827k7a3b439dlb4fa9d4083f26150@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2075 bytes --]

Hi Aki,

> Hi All,
>
> Here is a set of patches to add support for decoding SMSs that have
> been encoded using national language tables instead of the default GSM
> 7bit tables. I was planning to push a couple of these patches
> directly, but the changes turned out a bit more extensive than I
> originally thought. Please take a look and comment.

Just a couple of minor nitpicks:
+struct single_shift_table {
+	struct codepoint *table;
+	unsigned int len;
+};
+
+static struct single_shift_table gsm_single_shift[] =
+{
+	{ default_ext_gsm, TABLE_SIZE(default_ext_gsm) },
+	{ turkish_ext_gsm, TABLE_SIZE(turkish_ext_gsm) },
+	{ spanish_ext_gsm, TABLE_SIZE(spanish_ext_gsm) },
+	{ portuguese_ext_gsm, TABLE_SIZE(portuguese_ext_gsm) }
+};
+
+static struct single_shift_table unicode_single_shift[] =
+{
+	{ default_ext_unicode, TABLE_SIZE(default_ext_unicode) },
+	{ turkish_ext_unicode, TABLE_SIZE(turkish_ext_unicode) },
+	{ spanish_ext_unicode, TABLE_SIZE(spanish_ext_unicode) },
+	{ portuguese_ext_unicode, TABLE_SIZE(portuguese_ext_unicode) }
+};
+
+static const unsigned short *gsm_locking_shift[] =
+{
+	default_gsm,
+	turkish_gsm,
+	default_gsm,
+	portuguese_gsm
+};
+
+static struct codepoint *unicode_locking_shift[] =
+{
+	default_unicode,
+	turkish_unicode,
+	default_unicode,
+	portuguese_unicode

Can we put all of these into a single table?

+char *convert_gsm_to_utf8_with_lang(const unsigned char *text, long len,
+					long *items_read, long *items_written,
+					unsigned char terminator,
+					unsigned int locking_lang,
+					unsigned int single_lang)

locking_lang & single_lang should be unsigned char or an enum.

+gboolean sms_extract_language_variant(const struct sms *sms, int *locking,
+					int *single);

locking & single should use guint8.

+enum sms_language {
+	SMS_LANGUAGE_DEFAULT = 0,
+	SMS_LANGUAGE_TURKISH = 1,
+	SMS_LANGUAGE_SPANISH = 2,
+	SMS_LANGUAGE_PORTUGUESE = 3
+};
+

This part isn't used anywhere, should we just keep this out for now?

Regards,
-Denis

  reply	other threads:[~2009-09-04 16:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-04 15:27 Add support for SMS national language identifiers Aki Niemi
2009-09-04 16:21 ` Denis Kenzior [this message]
2009-09-07 11:49   ` Aki Niemi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200909041121.21109.denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox