Closed Bug 613440 Opened 14 years ago Closed 13 years ago

Cannot load ICM profile if profile path is non-ASCII

Categories

(Core :: Graphics: Color Management, defect)

All
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla5

People

(Reporter: m_kato, Assigned: m_kato)

References

(Depends on 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

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.
Attached patch fix (obsolete) — Splinter Review
Assignee: nobody → m_kato
Status: NEW → ASSIGNED
Attached patch fix v1.1Splinter Review
Attachment #496095 - Attachment is obsolete: true
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+
Depends on: post2.0
http://hg.mozilla.org/projects/cedar/rev/74729ced9c59
Flags: in-testsuite?
Whiteboard: fixed-in-cedar
http://hg.mozilla.org/mozilla-central/rev/74729ced9c59
Status: ASSIGNED → RESOLVED
Closed: 13 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.

Attachment

General

Created:
Updated:
Size: