Closed Bug 943284 Opened 11 years ago Closed 7 years ago

nsIndexedToHTML should not try to support non-UTF-8 file: URLs

Categories

(Core :: Networking, defect, P5)

defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: hsivonen, Assigned: m_kato)

References

Details

(Whiteboard: [necko-would-take])

Attachments

(1 file, 1 obsolete file)

It appears that we no longer support non-Unicode file systems anyway, so nsIndexedToHTML should stop using nsIPlatformCharset so that we might get rid of it.
Unfortunately nsIndexedToHTML is also used for FTP directory listings. That said, we could always convert the output using UTF-8, I guess. Character Encoding menu is already broken for directory listings.
Depends on: 26767
To make the output UTF-8, we need to %-encode URLs in the listing to prevent mis-conversion.
Depends on: 942791
Actually we still support non-UTF8 encoded file URL for backward compatibility on Windows. https://mxr.mozilla.org/mozilla-central/source/netwerk/base/src/nsURLHelperWin.cpp?rev=3d9424eb6eb4#99 Chrome also support this. IE doesn't unescape to parse file URLs.
(In reply to Masatoshi Kimura [:emk] from comment #3) > Actually we still support non-UTF8 encoded file URL for backward > compatibility on Windows. > https://mxr.mozilla.org/mozilla-central/source/netwerk/base/src/ > nsURLHelperWin.cpp?rev=3d9424eb6eb4#99 Does the nsIFile implementation use a legacy Windows API in that case directly, or does that stuff go through nsIPlatformCharset?
(In reply to Henri Sivonen (:hsivonen) from comment #4) > Does the nsIFile implementation use a legacy Windows API in that case > directly, or does that stuff go through nsIPlatformCharset? nsLocalFileWin::InitWithNativePath will convert the path with NS_CopyNativeToUnicode(). So we could replace nsIPlatformCharset with NS_CopyNativeToUnicode.
And don't forget about non-UTF-8 query part. Maybe replaceable with mozilla::Encoding::FallbackEncoding.
Whiteboard: [necko-would-take]
Priority: -- → P5
:m_kato, do you know if you'll be able to finish it in 58?
Flags: needinfo?(m_kato)
Assignee: nobody → m_kato
Flags: needinfo?(m_kato)
Since default encoding of Android and macOS is UTF-8, it doesn't need to retry using platform encoding.
Attachment #8895295 - Attachment is obsolete: true
Attachment #8919674 - Flags: review?(VYV03354)
Attachment #8919674 - Flags: review?(VYV03354) → review+
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/mozilla-inbound/rev/f32554cf5530 Use FallbackEncoding instead of nsIPlatformCharset r=emk
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: