Closed Bug 168737 Opened 22 years ago Closed 22 years ago

[FIX]Syntax coloring not working for UTF-16 encoded pages.

Categories

(Core Graveyard :: View Source, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.2beta

People

(Reporter: nikd, Assigned: bzbarsky)

References

()

Details

(Keywords: intl)

Attachments

(1 file)

Load http://www.student.lu.se/~kin02ndo/ (and any of the links there), and then
view the source. The page syntax is all black rather than colored.

Might be the byte order mark messing up something.

(Neither does wrapping of long lines in the source work, but that seems to be a
separate bug pertaining to all encodings.)
Confirmed using FizzillaCFM/2002091014 on 10.1.5.

Reassigning to View Source and adding intl keyword.

(Niklas, FYI, you have a couple of HTML syntax errors at that URL, including a
misquoted anchor attribute value (missing trailing quote) and an extraneous </div>.)
Assignee: yokoyama → doron
Severity: trivial → normal
Status: UNCONFIRMED → NEW
Component: Internationalization → ViewSource
Ever confirmed: true
Keywords: intl
QA Contact: ruixu → pmac
Thanks. Damn W3C validator doesn't recognize UTF-16. Could that be a tech
evangelism bug?
Attached patch Stupid fix.Splinter Review
caillon, could you review?
Assignee: doron → bzbarsky
OS: MacOS X → All
Priority: -- → P1
Hardware: Macintosh → All
Summary: Syntax coloring not working for UTF-16 encoded pages. → [FIX]Syntax coloring not working for UTF-16 encoded pages.
Target Milestone: --- → mozilla1.2beta
shouldn't that be added after the licence block?
No, because that would be illegal CSS.  The @charset rule must be the first
thing in the file; no comments, whitespace, whatever allowed before it.

If you think about it for 10 seconds, you should realize why that is (hint: how
do I parse the comment as a comment without knowing the encoding?)
>how do I parse the comment as a comment without knowing the encoding?

well... how do you parse the @charset without knowing the encoding? or should
that always be in US-ASCII?
You parse it by knowing that it's 7-bit-clean data possibly encoded in a 2 or 4
byte encoding.  Why ask me?  Just look it up --
http://lxr.mozilla.org/seamonkey/source/content/html/style/src/nsCSSLoader.cpp#611

The key is that it starts with a known useful string -- "@charset"
Comment on attachment 102425 [details] [diff] [review]
Stupid fix.

sr=rbs
Attachment #102425 - Flags: superreview+
Comment on attachment 102425 [details] [diff] [review]
Stupid fix.

a=asa for checkin to 1.2beta (on behalf of drivers)
Attachment #102425 - Flags: approval+
checked in
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
Product: SeaMonkey → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: