@@ -132,9 +132,7 @@ public HtmlInputStreamReader(InputStream inputStream,
132
132
if (encoding == null ) {
133
133
declared = false ;
134
134
} else if (encoding != Encoding .UTF8 ) {
135
- err ("Legacy encoding \u201C "
136
- + encoding .getCanonName ()
137
- + "\u201D used. Documents must use UTF-8." );
135
+ err (Encoding .msgLegacyEncoding (encoding .getCanonName ()));
138
136
}
139
137
if (encoding == null
140
138
&& (heuristics == Heuristics .CHARDET || heuristics == Heuristics .ALL )) {
@@ -150,7 +148,8 @@ public HtmlInputStreamReader(InputStream inputStream,
150
148
encoding = Encoding .WINDOWS1252 ;
151
149
}
152
150
if (!declared ) {
153
- err ("The character encoding was not declared. Proceeding using \u201C " + encoding .getCanonName () + "\u201D ." );
151
+ err ("The character encoding was not declared. Proceeding using"
152
+ + " \u201C " + encoding .getCanonName () + "\u201D ." );
154
153
}
155
154
if (driver != null ) {
156
155
driver .setEncoding (encoding , Confidence .TENTATIVE );
@@ -161,9 +160,7 @@ public HtmlInputStreamReader(InputStream inputStream,
161
160
driver .setEncoding (Encoding .UTF8 , Confidence .CERTAIN );
162
161
}
163
162
} else {
164
- err ("Legacy encoding \u201C "
165
- + encoding .getCanonName ()
166
- + "\u201D used. Documents must use UTF-8." );
163
+ err (Encoding .msgLegacyEncoding (encoding .getCanonName ()));
167
164
if (driver != null ) {
168
165
driver .setEncoding (Encoding .UTF16 , Confidence .CERTAIN );
169
166
}
0 commit comments