Cannot load ICM profile if profile path is non-ASCII

RESOLVED FIXED in mozilla5

Status

()

defect
RESOLVED FIXED
9 years ago
2 years ago

People

(Reporter: m_kato, Assigned: m_kato)

Tracking

(Depends on 1 bug)

Trunk
mozilla5
All
Windows 2000
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

9 years ago
http://mxr.mozilla.org/mozilla-central/source/gfx/thebes/gfxWindowsPlatform.cpp?mark=617-632#617

631     qcms_profile* profile =
632         qcms_profile_from_path(NS_ConvertUTF16toUTF8(str).get());

http://mxr.mozilla.org/mozilla-central/source/gfx/qcms/iccread.c?mark=813-816#813

813 qcms_profile* qcms_profile_from_path(const char *path)
814 {
815         qcms_profile *profile = NULL;
816         FILE *file = fopen(path, "rb");

ANSI C function on Windows cannot handle UTF8 path.  It uses native charset such as Shift JIS.  We should use wide C function on Windows without conversion.
(Assignee)

Comment 1

9 years ago
Posted patch fix (obsolete) — Splinter Review
Assignee: nobody → m_kato
Status: NEW → ASSIGNED
(Assignee)

Comment 2

9 years ago
Posted patch fix v1.1Splinter Review
Attachment #496095 - Attachment is obsolete: true
(Assignee)

Updated

9 years ago
Attachment #496097 - Flags: review?(jmuizelaar)
I think it would be cleaner if the platform specific logic wasn't exposed by the interface (by having specifics profile_from method) but if it was rather handled internally in qcms_profile_from_path.
(In reply to comment #3)
> I think it would be cleaner if the platform specific logic wasn't exposed by
> the interface (by having specifics profile_from method) but if it was rather
> handled internally in qcms_profile_from_path.

The problem with this approach is that it's not clear to me what the type of the path parameter should be. Currently, the path parameter's definition matches fopen. Since, fopen is broken on Windows I think it makes sense to expose a separate function that uses wfopen.
OS: Windows Vista → Windows 2000
Attachment #496097 - Flags: review?(jmuizelaar) → review+
(Assignee)

Updated

8 years ago
Duplicate of this bug: 560652
(Assignee)

Updated

8 years ago
Depends on: post2.0
http://hg.mozilla.org/mozilla-central/rev/74729ced9c59
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
No longer depends on: post2.0
Resolution: --- → FIXED
Whiteboard: fixed-in-cedar
Target Milestone: --- → mozilla2.2
You need to log in before you can comment on or make changes to this bug.