Closed Bug 520706 Opened 13 years ago Closed 13 years ago

Attachment checker doesn't work with CJK keyword

Categories

(Thunderbird :: Message Compose Window, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0rc1

People

(Reporter: m_kato, Assigned: m_kato)

References

Details

(Whiteboard: [no l10n impact])

Attachments

(1 file, 2 obsolete files)

- Step
1. Open [Options] - [General] - [Keywords...]
2. Fill CJK word such as "添付", and [OK]
3. Turned on [Check for missing attachments], and [OK]
4. Open compose window and input CJK such as 2.'s word

- Result
Alert bar disappear.  If keyword is ASCII, it works find.

- Expected Result
Work fine even if CJK.
Attached patch patch v1 (obsolete) — Splinter Review
Attachment #404754 - Flags: review?(mkmelin+mozilla)
Flags: blocking-thunderbird3?
Whiteboard: [no l10n impact]
Flags: blocking-thunderbird3? → blocking-thunderbird3+
Priority: -- → P3
Comment on attachment 404754 [details] [diff] [review]
patch v1


>+function IsCJKWord(aWord)
>+{
>+  for (i = 0; i < aWord.length; i++)

var i

>+    if (aWord.charCodeAt(i) >= 0x2000)
>+      return true;

Hm, this looks to be too wide. 
For instance xåäöy will be interpreted as a cjkword, which it's not.

Looks like the MDC example might be helpful, 
https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/String/CharCodeAt
Duplicate of this bug: 505470
Attached patch patch v2 (obsolete) — Splinter Review
Attachment #404754 - Attachment is obsolete: true
Attachment #404754 - Flags: review?(mkmelin+mozilla)
Attachment #405244 - Flags: review?(mkmelin+mozilla)
V2 doesn't work, the attachment worker doesn't like "let". I don't know if we ever figured out exactly why.
Attached patch patch v2.1Splinter Review
oops.  I mistake attached patch.
Attachment #405244 - Attachment is obsolete: true
Attachment #405244 - Flags: review?(mkmelin+mozilla)
Attachment #405975 - Flags: review?(mkmelin+mozilla)
Whiteboard: [no l10n impact] → [no l10n impact][has patch, needs review mkmelin]
Comment on attachment 405975 [details] [diff] [review]
patch v2.1

Thanks for the patch! r=mkmelin
Attachment #405975 - Flags: review?(mkmelin+mozilla) → review+
Keywords: checkin-needed
Whiteboard: [no l10n impact][has patch, needs review mkmelin] → [no l10n impact][ready to land]
Target Milestone: --- → Thunderbird 3.0rc1
landed
http://hg.mozilla.org/comm-central/rev/df3840aff5bf
Status: NEW → RESOLVED
Closed: 13 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [no l10n impact][ready to land] → [no l10n impact]
> +      // Hiragana, Katakana and Kanaji
Hmm? "Kanaji" should be Kanji, no? (感[じ])
Could we get a unit test for this ?
Flags: in-testsuite?
(In reply to comment #9)
> Hmm? "Kanaji" should be Kanji, no? (感[じ])

Ahh, this is typo of Kanji.

(In reply to comment #10)
> Could we get a unit test for this ?

Is there unit test of attachment checker??
No it doesn't have any test yet. If you're up to it it would be nice to have though.
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.