/[suikacvs]/markup/html/whatpm/Whatpm/HTML.pm.src
Suika

Diff of /markup/html/whatpm/Whatpm/HTML.pm.src

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.213 by wakaba, Sun Jun 28 11:03:06 2009 UTC revision 1.214 by wakaba, Thu Jul 2 22:08:37 2009 UTC
# Line 526  sub parse_byte_stream ($$$$;$$) { Line 526  sub parse_byte_stream ($$$$;$$) {
526      if ($char_stream) { # if supported      if ($char_stream) { # if supported
527        ## "Change the encoding" algorithm:        ## "Change the encoding" algorithm:
528    
529        ## Step 1            ## Step 2 (HTML5 revision 3205)
530          if (defined $self->{input_encoding} and
531              Message::Charset::Info->get_by_html_name ($self->{input_encoding})
532              ->{category} & Message::Charset::Info::CHARSET_CATEGORY_UTF16 ()) {
533            $self->{confident} = 1;
534            return;
535          }
536    
537          ## Step 3
538        if ($charset->{category} &        if ($charset->{category} &
539            Message::Charset::Info::CHARSET_CATEGORY_UTF16 ()) {            Message::Charset::Info::CHARSET_CATEGORY_UTF16 ()) {
540          $charset = Message::Charset::Info->get_by_html_name ('utf-8');          $charset = Message::Charset::Info->get_by_html_name ('utf-8');
# Line 536  sub parse_byte_stream ($$$$;$$) { Line 544  sub parse_byte_stream ($$$$;$$) {
544        }        }
545        $charset_name = $charset->get_iana_name;        $charset_name = $charset->get_iana_name;
546                
547        ## Step 2        ## Step 1 XXX
548        if (defined $self->{input_encoding} and        if (defined $self->{input_encoding} and
549            $self->{input_encoding} eq $charset_name) {            $self->{input_encoding} eq $charset_name) {
550          !!!parse-error (type => 'charset label:matching',          !!!parse-error (type => 'charset label:matching',
# Line 552  sub parse_byte_stream ($$$$;$$) { Line 560  sub parse_byte_stream ($$$$;$$) {
560                        level => $self->{level}->{warn},                        level => $self->{level}->{warn},
561                        token => $token);                        token => $token);
562                
563        ## Step 3        ## Step 4
564        # if (can) {        # if (can) {
565          ## change the encoding on the fly.          ## change the encoding on the fly.
566          #$self->{confident} = 1;          #$self->{confident} = 1;
567          #return;          #return;
568        # }        # }
569                
570        ## Step 4        ## Step 5
571        throw Whatpm::HTML::RestartParser ();        throw Whatpm::HTML::RestartParser ();
572      }      }
573    }; # $self->{change_encoding}    }; # $self->{change_encoding}

Legend:
Removed from v.1.213  
changed lines
  Added in v.1.214

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24