Last Comment Bug 779885 - navigator.mozContacts.getSimContacts() drops non-ASCII chars
: navigator.mozContacts.getSimContacts() drops non-ASCII chars
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla17
Assigned To: Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
:
:
Mentors:
Depends on:
Blocks: 1157082 751052 780825
  Show dependency treegraph
 
Reported: 2012-08-02 09:38 PDT by Fabien Cazenave [:kaze]
Modified: 2015-04-21 20:58 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch to show non-ASCII chars in SIM (3.72 KB, patch)
2012-08-06 02:14 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
vicamo: feedback-
Details | Diff | Splinter Review
WIP - Patch to show non-ASCII chars in SIM v2 (5.47 KB, patch)
2012-08-07 01:33 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
no flags Details | Diff | Splinter Review
WIP - Patch to show non-ASCII chars in SIM. v3 (5.43 KB, patch)
2012-08-07 03:54 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
no flags Details | Diff | Splinter Review
Patch to show non-ASCII chars in SIM. v4 (5.51 KB, patch)
2012-08-08 21:06 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
vicamo: review+
Details | Diff | Splinter Review
xpcshell tests (2.21 KB, patch)
2012-08-08 21:08 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
no flags Details | Diff | Splinter Review
Part 2: xpcshell tests v2 (2.55 KB, patch)
2012-08-09 03:15 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
vicamo: review+
Details | Diff | Splinter Review
Part 1: Patch to show non-ASCII chars in SIM. v4 (5.51 KB, patch)
2012-08-09 21:08 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
no flags Details | Diff | Splinter Review
Part 2: xpcshell tests v2 (2.55 KB, patch)
2012-08-09 21:09 PDT, Yoshi Huang[:allstars.chh] (OOO ~ 9.30)
no flags Details | Diff | Splinter Review

Description Fabien Cazenave [:kaze] 2012-08-02 09:38:41 PDT
STR:

 • using a dumbphone (e.g. my Nokia 1616), store contacts with French accented chars on the SIM card;
 • take the SIM card out, use it in a Samsung GS2, all contacts are properly imported;
 • take the SIM card out, use it in an Otoro with the latest Gonk/Gecko/Gaia, all accented characters are dropped (e.g. «Cédric» becomes «Cdric»).
Comment 1 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-08-03 00:29:17 PDT
I'll check SIM part first.
Comment 2 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-08-06 02:14:17 PDT
Created attachment 649222 [details] [diff] [review]
Patch to show non-ASCII chars in SIM

Hi Vicamo,
I add a function called readGsm8BitUnpackToString referenced from readSeptetsToString by your suggestion, would you take a look in it and give me some feedback?

Thanks
Comment 3 Vicamo Yang [:vicamo][:vyang] 2012-08-06 04:02:55 PDT
Comment on attachment 649222 [details] [diff] [review]
Patch to show non-ASCII chars in SIM

Review of attachment 649222 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/gonk/ril_worker.js
@@ +4074,5 @@
>    /**
> +   * Read GSM 8-bit unpacked octets,
> +   * which are SMS default 7-bit alphabets with bit 8 set to 0.
> +   */
> +  readGsm8BitUnpackedToString: function readGsm8BitUnpackedToString(length) {

Can you rename it to read8BitSeptetsToString()? That way we have similar names for the two septet string reading variants.

@@ +4077,5 @@
> +   */
> +  readGsm8BitUnpackedToString: function readGsm8BitUnpackedToString(length) {
> +    let ret = "";
> +    let escapeFound = false;
> +    const langTable = PDU_NL_LOCKING_SHIFT_TABLES[0];

we had defined PDU_NL_IDENTIFIER_DEFAULT for default charset index.

@@ +4079,5 @@
> +    let ret = "";
> +    let escapeFound = false;
> +    const langTable = PDU_NL_LOCKING_SHIFT_TABLES[0];
> +    const langShiftTable = PDU_NL_SINGLE_SHIFT_TABLES[0];
> +  

tailing white space

@@ +4123,5 @@
>    readUCS2String: function readUCS2String(numOctets) {
>      let str = "";
> +    for (let i = 0; i < numOctets; i++) {
> +      let temp = this.readHexOctet();
> +      if (temp == 0xff) {

Hey! UCS2 has no such restriction! For example, character 'Ͽ' has code 0x03FF.
Comment 4 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-08-07 01:33:30 PDT
Created attachment 649565 [details] [diff] [review]
WIP - Patch to show non-ASCII chars in SIM v2

- Address to Vicamo's review comments.
- Add a function 'readICCUCS2String' to read UCS2 String on ICC.
Comment 5 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-08-07 03:54:01 PDT
Created attachment 649592 [details] [diff] [review]
WIP - Patch to show non-ASCII chars in SIM. v3
Comment 6 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-08-08 21:06:50 PDT
Created attachment 650435 [details] [diff] [review]
Patch to show non-ASCII chars in SIM. v4

Hi Vicamo
Could you review this patch for me?

Thanks
Comment 7 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-08-08 21:08:43 PDT
Created attachment 650436 [details] [diff] [review]
xpcshell tests

Hi, Vicamo
This is the xpcshell tests.

Thanks
Comment 8 Vicamo Yang [:vicamo][:vyang] 2012-08-09 01:42:57 PDT
Comment on attachment 650435 [details] [diff] [review]
Patch to show non-ASCII chars in SIM. v4

Review of attachment 650435 [details] [diff] [review]:
-----------------------------------------------------------------

Sweet!
Comment 9 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-08-09 03:15:09 PDT
Created attachment 650489 [details] [diff] [review]
Part 2: xpcshell tests v2

update tests
Comment 10 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-08-09 21:08:47 PDT
Created attachment 650779 [details] [diff] [review]
Part 1: Patch to show non-ASCII chars in SIM. v4

rebase
Comment 11 Yoshi Huang[:allstars.chh] (OOO ~ 9.30) 2012-08-09 21:09:41 PDT
Created attachment 650780 [details] [diff] [review]
Part 2: xpcshell tests v2

rebase

Note You need to log in before you can comment on or make changes to this bug.