Skip to content

Commit

Permalink
first part of supporting Charset
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenartur committed Aug 25, 2024
1 parent 977582b commit 25bbdb3
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public class LibStandardNames {
*
*/
public static final String METHOD_GET_BYTES= "getBytes"; //$NON-NLS-1$
/**
*
*/
public static final String METHOD_FOR_NAME= "forName"; //$NON-NLS-1$
/**
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

public enum UseExplicitEncodingFixCore {

CHARSET(new StringGetBytesExplicitEncoding()),
STRING_GETBYTES(new StringGetBytesExplicitEncoding()),
INPUTSTREAMREADER(new InputStreamReaderExplicitEncoding()),
OUTPUTSTREAMWRITER(new OutputStreamWriterExplicitEncoding()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,54 @@ public class Java9CleanUpTest {

enum ExplicitEncodingPatterns {

// CHARSET("""
// package test1;
//
// import java.io.ByteArrayOutputStream;
// import java.io.InputStreamReader;
// import java.io.FileInputStream;
// import java.io.FileReader;
// import java.io.Reader;
// import java.io.FileNotFoundException;
//
// public class E1 {
// void method(String filename) {
// Charset cs1= Charset.forName("UTF-8");
// Charset cs2= Charset.forName("UTF-16");
// Charset cs3= Charset.forName("UTF-16BE");
// Charset cs4= Charset.forName("UTF-16LE");
// Charset cs5= Charset.forName("ISO-8859-1");
// Charset cs6= Charset.forName("US-ASCII");
// String result= cs1.toString();
// }
// }
// }
// """,
//
// """
// package test1;
//
// import java.io.ByteArrayOutputStream;
// import java.io.InputStreamReader;
// import java.io.FileInputStream;
// import java.io.FileReader;
// import java.io.Reader;
// import java.nio.charset.Charset;
// import java.io.FileNotFoundException;
//
// public class E1 {
// void method(String filename) {
// Charset cs1= StandardCharsets.UTF_8;
// Charset cs2= StandardCharsets.UTF_16;
// Charset cs3= StandardCharsets.UTF_16BE;
// Charset cs4= StandardCharsets.UTF_16LE;
// Charset cs5= StandardCharsets.ISO_8859_1;
// Charset cs6= StandardCharsets.US_ASCII;
// String result= cs.toString();
// }
// }
// }
// """),
BYTEARRAYOUTSTREAM("""
package test1;
Expand Down

0 comments on commit 25bbdb3

Please sign in to comment.