@@ -139,9 +139,7 @@ public HtmlInputStreamReader(InputStream inputStream,
139
139
if (encoding == null ) {
140
140
declared = false ;
141
141
} else if (encoding != Encoding .UTF8 ) {
142
- err ("Legacy encoding \u201C "
143
- + encoding .getCanonName ()
144
- + "\u201D used. Documents must use UTF-8." );
142
+ err (Encoding .msgLegacyEncoding (encoding .getCanonName ()));
145
143
}
146
144
if (encoding == null
147
145
&& (heuristics == Heuristics .CHARDET || heuristics == Heuristics .ALL )) {
@@ -157,7 +155,8 @@ public HtmlInputStreamReader(InputStream inputStream,
157
155
encoding = Encoding .WINDOWS1252 ;
158
156
}
159
157
if (!declared ) {
160
- err ("The character encoding was not declared. Proceeding using \u201C " + encoding .getCanonName () + "\u201D ." );
158
+ err ("The character encoding was not declared. Proceeding using"
159
+ + " \u201C " + encoding .getCanonName () + "\u201D ." );
161
160
}
162
161
if (driver != null ) {
163
162
driver .setEncoding (encoding , Confidence .TENTATIVE );
@@ -168,9 +167,7 @@ public HtmlInputStreamReader(InputStream inputStream,
168
167
driver .setEncoding (Encoding .UTF8 , Confidence .CERTAIN );
169
168
}
170
169
} else {
171
- err ("Legacy encoding \u201C "
172
- + encoding .getCanonName ()
173
- + "\u201D used. Documents must use UTF-8." );
170
+ err (Encoding .msgLegacyEncoding (encoding .getCanonName ()));
174
171
if (driver != null ) {
175
172
driver .setEncoding (Encoding .UTF16 , Confidence .CERTAIN );
176
173
}
0 commit comments