Closed Bug 18624 Opened 25 years ago Closed 25 years ago

Extra space in the meta tag prevents Japanese page loading correctly.

Categories

(Core :: Internationalization, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: tao, Assigned: ftang)

References

()

Details

(Whiteboard: 1 line (character) fix)

Please load the page in the URL field to see that a Shift_JIS encoded
page is not rendered correctly. Changing the charset from the "View"
menu to "Shift_JIS" will redisplay it right.


If you view its page source, you'll find that the meta tag looks like
this:

 <META HTTP-EQUIV="Content-Type" CONTENT="text/html ; charset=Shift_JIS">
                                                   ^
Note that there is an extra space marked at "^".
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
The page itself is invalid. There should not have a space between text/html and
';'  accoruding to RFC 2045:
http://www.cis.ohio-state.edu/htbin/rfc/rfc2045.html
Won't fix it. Ask the webmaster to fix his/her page...

5.1.  Syntax of the Content-Type Header Field

   In the Augmented BNF notation of RFC 822, a Content-Type header field
   value is defined as follows:

     content := "Content-Type" ":" type "/" subtype
                *(";" parameter)
                ; Matching of media type and subtype
                ; is ALWAYS case-insensitive.

     type := discrete-type / composite-type

     discrete-type := "text" / "image" / "audio" / "video" /
                      "application" / extension-token

     composite-type := "message" / "multipart" / extension-token

     extension-token := ietf-token / x-token

     ietf-token := <An extension token defined by a
                    standards-track RFC and registered
                    with IANA.>

     x-token := <The two characters "X-" or "x-" followed, with
                 no intervening white space, by any token>

     subtype := extension-token / iana-token

     iana-token := <A publicly-defined extension token. Tokens
                    of this form must be registered with IANA
                    as specified in RFC 2048.>

     parameter := attribute "=" value

     attribute := token
                  ; Matching of attributes
                  ; is ALWAYS case-insensitive.

     value := token / quoted-string

     token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
                 or tspecials>

     tspecials :=  "(" / ")" / "<" / ">" / "@" /
                   "," / ";" / ":" / "\" / <">
                   "/" / "[" / "]" / "?" / "="
                   ; Must be in quoted-string,
                   ; to use within parameter values
But, weren't we more tolerant to errors in HTML page as opposed to XMLs? Seems
to me, 4.x renders the page properly. If we tighten the rule, won't there
international HTML pages stop rendering "properly" in 5.0 client.
I agree with Tao. 4.X allows a space between text/html and ; so 5.0 should allow
a space there too.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Reopen this to consider again.
Status: REOPENED → ASSIGNED
Target Milestone: M13
Fix it is easy.
cvs server: Diffing src
Index: src/nsMetaCharsetObserver.cpp
===================================================================
RCS file: /m/pub/mozilla/intl/chardet/src/nsMetaCharsetObserver.cpp,v
retrieving revision 1.20
diff -c -r1.20 nsMetaCharsetObserver.cpp
*** nsMetaCharsetObserver.cpp   1999/12/07 14:05:25     1.20
--- nsMetaCharsetObserver.cpp   1999/12/17 23:01:13
***************
*** 211,217 ****
                contentValue=valueArray[i];
        }
        static nsAutoString contenttype("Content-Type");
!       static nsAutoString texthtml("text/html;");
        if((nsnull != httpEquivValue) &&
           (nsnull != contentValue) &&
           ((0==nsCRT::strcasecmp(httpEquivValue,contenttype.GetUnicode())) ||
--- 211,217 ----
                contentValue=valueArray[i];
        }
        static nsAutoString contenttype("Content-Type");
!       static nsAutoString texthtml("text/html");
        if((nsnull != httpEquivValue) &&
           (nsnull != contentValue) &&
           ((0==nsCRT::strcasecmp(httpEquivValue,contenttype.GetUnicode())) ||
cvs server: Diffing src/classic
This is a one character change.
Mark it for M13
Whiteboard: 1 line (character) fix
Status: ASSIGNED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
remove one ";" after "text/html" when we do attribute comparsion
I verified this in 2000020110 Win32 build.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.