File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/java/org/jsoup/helper Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 14
14
import java .io .RandomAccessFile ;
15
15
import java .nio .ByteBuffer ;
16
16
import java .nio .charset .Charset ;
17
- import java .util .Locale ;
18
17
import java .util .Random ;
19
18
import java .util .regex .Matcher ;
20
19
import java .util .regex .Pattern ;
@@ -211,7 +210,11 @@ private static String validateCharset(String cs) {
211
210
if (cs == null || cs .length () == 0 ) return null ;
212
211
cs = cs .trim ().replaceAll ("[\" ']" , "" );
213
212
if (PortUtil .charsetIsSupported (cs )) return cs ;
214
- cs = cs .toUpperCase (Locale .ENGLISH );
213
+ StringBuilder upperCase = new StringBuilder ();
214
+ for (int i = 0 ; i < cs .length (); i ++) {
215
+ upperCase .append (Character .toUpperCase (cs .charAt (i )));
216
+ }
217
+ cs = upperCase .toString ();
215
218
if (PortUtil .charsetIsSupported (cs )) return cs ;
216
219
// if our this charset matching fails.... we just take the default
217
220
return null ;
You can’t perform that action at this time.
0 commit comments