All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] util: Fix GSM to UTF8 conversion mechanism
Date: Sun, 15 Jul 2012 19:49:37 -0500	[thread overview]
Message-ID: <50036521.4030005@gmail.com> (raw)
In-Reply-To: <1342449278-26294-1-git-send-email-guillaume.zajac@linux.intel.com>

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

Hi Guillaume,

On 07/16/2012 09:34 AM, Guillaume Zajac wrote:
> ---
>   src/util.c |   17 ++++++++++++++---
>   1 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/src/util.c b/src/util.c
> index aecc790..41ef3d4 100644
> --- a/src/util.c
> +++ b/src/util.c
> @@ -628,8 +628,16 @@ char *convert_gsm_to_utf8_with_lang(const unsigned char *text, long len,
>
>   			c = gsm_single_shift_lookup(&t, text[i]);
>
> +			/*
> +			 * According to the 3GPP specifications 23.038
> +			 * section 6.2.1.1:
> +			 * In the case there is no character in the extension
> +			 * table, the character of the main default alphabet
> +			 * table or the character from the National Language
> +			 * Locking Shift Table should be displayed.
> +			 */

What version of 23.038 are you using? I cannot find such wording in R9 
or R10 specs.

>   			if (c == GUND)
> -				goto error;
> +				c = gsm_locking_shift_lookup(&t, text[i]);
>   		} else {
>   			c = gsm_locking_shift_lookup(&t, text[i]);
>   		}
> @@ -647,9 +655,12 @@ char *convert_gsm_to_utf8_with_lang(const unsigned char *text, long len,
>   	while (out<  res + res_length) {
>   		unsigned short c;
>
> -		if (text[i] == 0x1b)
> +		if (text[i] == 0x1b) {
>   			c = gsm_single_shift_lookup(&t, text[++i]);
> -		else
> +			/* See 3GPP 23.038 section 6.2.1.1 */
> +			if (c == GUND)
> +				c = gsm_locking_shift_lookup(&t, text[i]);
> +		} else
>   			c = gsm_locking_shift_lookup(&t, text[i]);
>
>   		out += g_unichar_to_utf8(c, out);

Regards,
-Denis

  reply	other threads:[~2012-07-16  0:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-16 14:34 [PATCH] util: Fix GSM to UTF8 conversion mechanism Guillaume Zajac
2012-07-16  0:49 ` Denis Kenzior [this message]
2012-07-17  8:41   ` Guillaume Zajac
2012-07-17  2:09     ` Denis Kenzior
2012-07-18  8:06       ` Guillaume Zajac
2012-07-18 12:31         ` Marcel Holtmann
2012-07-18 13:54           ` Guillaume Zajac
2012-07-17 18:14             ` Denis Kenzior
2012-07-17  3:53 ` Denis Kenzior

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=50036521.4030005@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.