navigator.mozContacts.getSimContacts() drops non-ASCII chars

RESOLVED FIXED in mozilla17

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
5 years ago
2 years ago

People

(Reporter: kaze, Assigned: allstars)

Tracking

(Blocks: 1 bug)

unspecified
mozilla17
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 6 obsolete attachments)

(Reporter)

Description

5 years ago
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»).
OS: Linux → All
Hardware: x86_64 → All
Blocks: 751052
Component: General → DOM: Device Interfaces
Product: Boot2Gecko → Core
(Assignee)

Comment 1

5 years ago
I'll check SIM part first.
Assignee: nobody → allstars.chh
(Assignee)

Comment 2

5 years ago
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
Attachment #649222 - Flags: feedback?(vyang)
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.
Attachment #649222 - Flags: feedback?(vyang) → feedback-
(Assignee)

Updated

5 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 4

5 years ago
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.
Attachment #649222 - Attachment is obsolete: true
(Assignee)

Comment 5

5 years ago
Created attachment 649592 [details] [diff] [review]
WIP - Patch to show non-ASCII chars in SIM. v3
Attachment #649565 - Attachment is obsolete: true
(Assignee)

Comment 6

5 years ago
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
Attachment #649592 - Attachment is obsolete: true
Attachment #650435 - Flags: review?(vyang)
(Assignee)

Comment 7

5 years ago
Created attachment 650436 [details] [diff] [review]
xpcshell tests

Hi, Vicamo
This is the xpcshell tests.

Thanks
Attachment #650436 - Flags: review?(vyang)
(Assignee)

Updated

5 years ago
Blocks: 780825
Comment on attachment 650435 [details] [diff] [review]
Patch to show non-ASCII chars in SIM. v4

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

Sweet!
Attachment #650435 - Flags: review?(vyang) → review+
(Assignee)

Comment 9

5 years ago
Created attachment 650489 [details] [diff] [review]
Part 2: xpcshell tests v2

update tests
Attachment #650436 - Attachment is obsolete: true
Attachment #650436 - Flags: review?(vyang)
Attachment #650489 - Flags: review?(vyang)
Attachment #650489 - Flags: review?(vyang) → review+
(Assignee)

Comment 10

5 years ago
Created attachment 650779 [details] [diff] [review]
Part 1: Patch to show non-ASCII chars in SIM. v4

rebase
Attachment #650435 - Attachment is obsolete: true
(Assignee)

Comment 11

5 years ago
Created attachment 650780 [details] [diff] [review]
Part 2: xpcshell tests v2

rebase
Attachment #650489 - Attachment is obsolete: true
(Assignee)

Comment 12

5 years ago
Part 1: https://hg.mozilla.org/integration/mozilla-inbound/rev/461d2a2a5b88
Part 2: https://hg.mozilla.org/integration/mozilla-inbound/rev/8405e424a351
Target Milestone: --- → mozilla17
https://hg.mozilla.org/mozilla-central/rev/461d2a2a5b88
https://hg.mozilla.org/mozilla-central/rev/8405e424a351
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Updated

2 years ago
Blocks: 1157082
You need to log in before you can comment on or make changes to this bug.