Closed Bug 302230 Opened 19 years ago Closed 19 years ago

Cannot import bookmark of MacIE written in Japanese

Categories

(Firefox :: Bookmarks & History, defect, P1)

PowerPC
macOS
defect

Tracking

()

RESOLVED FIXED
Firefox1.5

People

(Reporter: sugar.waffle, Assigned: masayuki)

References

Details

(Keywords: intl)

Attachments

(4 files, 2 obsolete files)

All Japanese is illegal in migration of MacIE. 

Mac OS X 10.3.9
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b4) Gecko/20050726
Firefox/1.0+
Perhaps, "x-mac-roman" is set to "charset" in Bookmark of MacIE as for any
language version. 

I think that there is a necessity for asking the user the language if it is 
impossible according to an automatic type of the character-code. 

Depends on: 236304
Summary: Japanese is illegal in migration of MacIE. → Japanese is illegal in migration of MacIE.
Taking.

If the META tag declared "x-mac-roman", the user has changed the OS locale to
using English locale or the user is using old version IE. We should ignore old
IE users. Because the user should use latest version browser(for security). And
newer IE works fine on OS's locale. So we should regard the META declaration.
But if the locale is Japan, IE using "x-sjis". But nsBookmarkService.cpp doesn't
allow to use alias. Therefore, we cannot import the bookmark if that is written
in Japanese.
Assignee: nobody → masayuki
Severity: normal → major
Component: Migration → Bookmarks
Keywords: intl
Priority: -- → P1
Status: NEW → ASSIGNED
Attached patch Patch rv4.0 (obsolete) — Splinter Review
This patch fixes this bug.
Current code doesn't allow alias charset name in META tag.
We should allow it for MacIE's bookmark file.

And I'm changing following code:

-	 rv = ParseMetaTag(line, getter_AddRefs(mUnicodeDecoder));
+	 nsCOMPtr<nsIUnicodeDecoder> unicodeDecoder = nsnull;
+	 rv = ParseMetaTag(line, getter_AddRefs(unicodeDecoder));
+	 if (NS_SUCCEEDED(rv) && unicodeDecoder) {
+	     mUnicodeDecoder = unicodeDecoder;
+	 }

We should not set mUnicodeDecoder directly. Because in ParseMetaTag, it is
always initialized by nsnull or any Unicode decoder. This behavior is not good.
Because if it is not declaration of Content-Type, it always returns null. So,
the process is faild.
Attachment #191347 - Flags: review?(joshmoz)
Flags: blocking1.8b4?
Target Milestone: --- → Firefox1.1
Comment on attachment 191347 [details] [diff] [review]
Patch rv4.0

>
>+    nsCOMPtr<nsICharsetAlias> charsetAlias =
>+        do_GetService(NS_CHARSETALIAS_CONTRACTID, &rv);
>+    NS_ENSURE_SUCCESS(rv, rv);
>+
>+    nsCAutoString preferredCharset;
>+    rv = charsetAlias->GetPreferred(charset, preferredCharset);
>+    NS_ENSURE_SUCCESS(rv, rv);
>

You don't need the above.  You can just  use GetUnicodeDecoder in place of
GetUnicodeDecoderRaw below. 

>-        rv = charsetConv->GetUnicodeDecoderRaw(charset.get(), decoder);
Attachment #191347 - Flags: review?(joshmoz)
Attached patch Patch rv4.1Splinter Review
Thank you, Jungshik.
Attachment #191347 - Attachment is obsolete: true
Attachment #191358 - Flags: review?(joshmoz)
Comment on attachment 191358 [details] [diff] [review]
Patch rv4.1

I'll review this tomorrow.
Attachment #191358 - Flags: review?(joshmoz) → review?(bugs.mano)
Comment on attachment 191358 [details] [diff] [review]
Patch rv4.1

I get the same results w/ and w/o this patch, at least with the attached
'testcase' as my ie bookmarks file.

(In any case, you can poke my on moznet, nick: Mano).
Attachment #191358 - Flags: review?(bugs.mano) → review-
Comment on attachment 191358 [details] [diff] [review]
Patch rv4.1

http://bugzilla.mozilla.gr.jp/attachment.cgi?id=2868&action=view
This is default bookmark of MacIE-JA.
Please check it.
Attachment #191358 - Flags: review- → review?(bugs.mano)
Summary: Japanese is illegal in migration of MacIE. → Cannot import bookmark of MacIE written in Japanese
we'd consider a reviewed patch but we're not going to block on this.
Flags: blocking1.8b4? → blocking1.8b4-
bugzilla.mozilla.gr.jp server is down now.
If you test the patch, please use this file instead of I pointed URL.
Attachment #190591 - Attachment is obsolete: true
Comment on attachment 191358 [details] [diff] [review]
Patch rv4.1

>Index: browser/components/bookmarks/src/nsBookmarksService.cpp
>===================================================================

>     else if ((offset = line.Find(kOpenMeta, PR_TRUE)) >= 0)
>     {
>-        rv = ParseMetaTag(line, getter_AddRefs(mUnicodeDecoder));
>+        nsCOMPtr<nsIUnicodeDecoder> unicodeDecoder = nsnull;
>+        rv = ParseMetaTag(line, getter_AddRefs(unicodeDecoder));
>+        if (NS_SUCCEEDED(rv) && unicodeDecoder) {

Add the following comment here:
// We are not setting mUnicodeDecoder directly since ParseMetaTag set the
// returned decoded to null if this is not a Content-Type declaration.

>+            mUnicodeDecoder = unicodeDecoder;
>+        }
>     }

r=mano.
Attachment #191358 - Flags: review?(bugs.mano)
Attachment #191358 - Flags: review+
Attachment #191358 - Flags: approval1.8b4?
Attachment #191358 - Flags: approval1.8b4? → approval1.8b4+
checked-in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: