Closed Bug 837226 Opened 11 years ago Closed 7 years ago

Rename the |utf8| variable in MetroUtils Log function: It holds an acp-encoded (not utf8-encoded) string

Categories

(Firefox for Metro Graveyard :: General, defect)

x86_64
Windows 8.1
defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: TimAbraldes, Unassigned)

References

Details

(Whiteboard: p=0)

Attachments

(1 file)

Attached patch Patch v1 (WIP)Splinter Review
The Log function in MetroUtils currently converts unicode strings to the system codepage before passing them to PR_LOG.  It should convert them to UTF8.

Attached is an untested WIP patch.
Whiteboard: [metro-mvp?]
What does this work get us for v1 that we need?
This isn't necessary for v1.  The effect of this bug is likely just that certain characters will not appear correctly in some logs.
Assignee: tabraldes → nobody
Whiteboard: [metro-mvp?]
(In reply to Tim Abraldes (:tabraldes) from comment #0)
> The Log function in MetroUtils currently converts unicode strings to the
> system codepage before passing them to PR_LOG.  It should convert them to
> UTF8.

Why? I thought PR_LOG takes a string encoded in the system codepage on Windows.
(In reply to Masatoshi Kimura [:emk] from comment #3)
> (In reply to Tim Abraldes (:tabraldes) from comment #0)
> > The Log function in MetroUtils currently converts unicode strings to the
> > system codepage before passing them to PR_LOG.  It should convert them to
> > UTF8.
> 
> Why? I thought PR_LOG takes a string encoded in the system codepage on
> Windows.

What I really meant was that the code appears to be trying to convert a utf-16 string into a utf-8 string (since the variable it stores the result in is called "utf8"), but it is actually converting it to the system codepage.  If PR_LOG expects a string encoded in the system codepage then this code does what it is supposed to do (though the variable name should be changed).
(In reply to Tim Abraldes (:tabraldes) from comment #4)
> What I really meant was that the code appears to be trying to convert a
> utf-16 string into a utf-8 string (since the variable it stores the result
> in is called "utf8"), but it is actually converting it to the system
> codepage.  If PR_LOG expects a string encoded in the system codepage then
> this code does what it is supposed to do (though the variable name should be
> changed).

Wow, |utf8| is definitely a confusing name. Please change the name, rather than the behavior.
Updating title of bug
Severity: normal → trivial
Summary: Fix MetroUtils Log function to correctly handle unicode strings → Rename the |utf8| variable in MetroUtils Log function: It holds an acp-encoded (not utf8-encoded) string
No longer blocks: metrov1triage
Blocks: metrobacklog
Status: ASSIGNED → NEW
Whiteboard: p=0
OS: Windows 8 Metro → Windows 8.1
Mass close of bugs in obsolete product https://bugzilla.mozilla.org/show_bug.cgi?id=1350354
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: