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

RESOLVED FIXED in mozilla1.2beta

Status

P1
normal
RESOLVED FIXED
16 years ago
8 years ago

People

(Reporter: nikd, Assigned: bzbarsky)

Tracking

({intl})

Trunk
mozilla1.2beta

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
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.)

Comment 1

16 years ago
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
(Reporter)

Comment 2

16 years ago
Thanks. Damn W3C validator doesn't recognize UTF-16. Could that be a tech
evangelism bug?
(Assignee)

Comment 4

16 years ago
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

Comment 6

16 years ago
shouldn't that be added after the licence block?
(Assignee)

Comment 7

16 years ago
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?
(Assignee)

Comment 9

16 years ago
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 10

16 years ago
Comment on attachment 102425 [details] [diff] [review]
Stupid fix.

sr=rbs
Attachment #102425 - Flags: superreview+

Comment 11

16 years ago
Comment on attachment 102425 [details] [diff] [review]
Stupid fix.

a=asa for checkin to 1.2beta (on behalf of drivers)
Attachment #102425 - Flags: approval+
Just FYI, for those who care:

http://www.w3.org/TR/CSS2/syndata.html#q23
http://www.w3.org/TR/CSS21/syndata.html#q19

Fourth paragraph explains the @charset at-rule.
(Assignee)

Comment 13

16 years ago
checked in
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey

Updated

8 years ago
Component: View Source → View Source
Product: SeaMonkey → Core Graveyard
You need to log in before you can comment on or make changes to this bug.