All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 1/4] Add so called reduced charset support to SMS
Date: Thu, 02 Sep 2010 11:43:40 -0500	[thread overview]
Message-ID: <4C7FD43C.4020300@gmail.com> (raw)
In-Reply-To: <1283413960-31490-1-git-send-email-aki.niemi@nokia.com>

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

Hi Aki,

On 09/02/2010 02:52 AM, Aki Niemi wrote:
> This "reduced" charset support is available in some current phones to
> reduce the number of segments that a message takes.
> 
> Normally, when characters are encountered that don't have a
> representation in the GSM 7 bit alphabet, the encoding switches to
> UCS-2 that takes roughly twice as much space.
> 
> This reduced charset feature transliterates the input string, so that
> more unicode characters fit the GSM alphabet. The obvious downside is
> that transliterating loses information, i.e., the text gets dumbed
> down, and what the recipient receives is not the original text.
> 
> Nevertheless, in some regions, this is a must-have feature.
> ---
>  src/util.c       |  137 +++++++++++++++++++++++++++++++++++++++++++++++++++---
>  src/util.h       |    4 ++
>  unit/test-util.c |   18 +++++++

Please break this up into two patches.  By convention patches that touch
multiple directories should be broken up, unless needed for compilation
to succeed.

>  3 files changed, 152 insertions(+), 7 deletions(-)

<snip>

> 
> -	if (locking_lang >= GSM_DIALECT_INVALID)
> +	if (locking_lang > GSM_DIALECT_INVALID)
>  		return NULL;
>  
> -	if (single_lang >= GSM_DIALECT_INVALID)
> +	if (single_lang > GSM_DIALECT_INVALID)
>  		return NULL;
>  

I think this is simply too evil, can't we just change
unicode_single_shift_lookup and gsm_locking_shift_lookup to take the
codepoint table and length directly?  Then breakout the core of
convert_gsm_to_utf8_with_lang into a separate function and pass the
table + len to it.  Should be cleaner and more readable in my opinion.

Regards,
-Denis

      parent reply	other threads:[~2010-09-02 16:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-02  7:52 [PATCH 1/4] Add so called reduced charset support to SMS Aki Niemi
2010-09-02  7:52 ` [PATCH 2/4] Enable alphabets in smsutils Aki Niemi
2010-09-02 16:55   ` Denis Kenzior
2010-09-03 12:15     ` Aki Niemi
2010-09-03 14:05       ` Denis Kenzior
2010-09-03 14:12         ` Aki Niemi
2010-09-03 14:40   ` Pekka Pessi
2010-09-03 15:08     ` Denis Kenzior
2010-09-03 17:09     ` Aki Niemi
2010-09-02  7:52 ` [PATCH 3/4] Add alphabet support to SMS atom Aki Niemi
2010-09-02 17:00   ` Denis Kenzior
2010-09-02  7:52 ` [PATCH 4/4] Add documentation for the Alphabet property Aki Niemi
2010-09-02 17:01   ` Denis Kenzior
2010-09-02 18:19     ` Marcel Holtmann
2010-09-02 19:08       ` Aki Niemi
2010-09-02 16:43 ` Denis Kenzior [this message]

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=4C7FD43C.4020300@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.