Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Issue 6740005: Handle UCS-2 data coding scheme for SMS messsages. (Closed)

Created:
9 years, 8 months ago by Eric Shienbrood
Modified:
9 years, 7 months ago
Reviewers:
Nathan Williams
CC:
chromium-os-reviews_chromium.org
Visibility:
Public.

Description

Handle UCS-2 data coding scheme for SMS messsages. Also, handle alpha format for SMS sender "number". Turns out carriers sometimes use this instead of E.164 when they originate a message. BUG=chromium-os:13617 TEST=Unit tests using data taken from actual messages sent from a Russian carrier to a Russian handset. Change-Id: I78db5fff784f0d1dc0381e60768c177b58b6d800 R=njw@chromium.org Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=0c0da8f

Patch Set 1 #

Total comments: 8

Patch Set 2 : Respond to Nathan's comments #

Patch Set 3 : Remove redundant comparison operations #

Unified diffs Side-by-side diffs Delta from patch set Stats (+234 lines, -45 lines) Patch
M sms_message.cc View 1 7 chunks +49 lines, -23 lines 0 comments Download
M sms_message_unittest.cc View 4 chunks +21 lines, -3 lines 0 comments Download
M utilities.h View 3 chunks +14 lines, -2 lines 0 comments Download
M utilities.cc View 1 2 2 chunks +56 lines, -1 line 0 comments Download
M utilities_unittest.cc View 7 chunks +94 lines, -16 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Eric Shienbrood
9 years, 8 months ago (2011-03-30 22:14:08 UTC) #1
Nathan Williams
http://codereview.chromium.org/6740005/diff/1/sms_message.cc File sms_message.cc (right): http://codereview.chromium.org/6740005/diff/1/sms_message.cc#newcode151 sms_message.cc:151: uint8_t dcs = pdu[tp_pid_offset+1] & 0x0c; We're losing the ...
9 years, 8 months ago (2011-03-30 22:31:54 UTC) #2
Eric Shienbrood
PTAL http://codereview.chromium.org/6740005/diff/1/sms_message.cc File sms_message.cc (right): http://codereview.chromium.org/6740005/diff/1/sms_message.cc#newcode151 sms_message.cc:151: uint8_t dcs = pdu[tp_pid_offset+1] & 0x0c; On 2011/03/30 ...
9 years, 8 months ago (2011-03-31 20:03:59 UTC) #3
Nathan Williams
Down to nits, so LGTM. > On 2011/03/30 22:31:54, Nathan Williams wrote: > > Is ...
9 years, 8 months ago (2011-03-31 20:41:19 UTC) #4
Eric Shienbrood
9 years, 8 months ago (2011-03-31 21:06:21 UTC) #5
PTAL. I removed the unneeded comparisons.

On 2011/03/31 20:41:19, Nathan Williams wrote:
> Down to nits, so LGTM.
> 
> > On 2011/03/30 22:31:54, Nathan Williams wrote:
> > > Is it possible for the SMS UCS2 strings to start with a byte-order mark?
> > > Big-endian certainly seems to be conventional here, but I haven't seen
> > anything
> > > ruling out little-endian with a BOM, or an extraneous big-endian BOM.
> > 
> > Given what the 3GPP spec 23.040 says, can we skip worrying about this for
the
> > moment? I know it would be more robust to deal with it, but I'd rather wait
> > until we know there's a need.
> 
> Yeah, given that explicit claim of big-endianness, and my total inability to
> find evidence of little-endian UCS2 or UCS2 with BOMs in the wild in SMS
> messages, skipping it seems fine. 
> 
> > 
> > http://codereview.chromium.org/6740005/diff/1/utilities.cc#newcode284
> > utilities.cc:284: } else if (0x80 <= ucs2char && ucs2char <= 0x7ff) {
> > On 2011/03/30 22:31:54, Nathan Williams wrote:
> > > The <= part is redundant, though probably harmless.
> > 
> > Why is it redundant?
> 
> Oops, I didn't see that both clauses were <=. I meant that the "0x80 <=
> usc2char" part is redundant, since this is the else clause from "ucs2char <=
> 0x7f". Similarly, in the previous clause, "0 <= ucs2char" is redundant since
> ucs2char is unsigned (actually, doesn't gcc warn about that?). But, still,
> harmless and possibly good for clarity.

Powered by Google App Engine
This is Rietveld 408576698