We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0df8ea commit d006b72Copy full SHA for d006b72
core-java-modules/core-java-string-conversions-4/EBCDIC_to_ASCII/ASCII_EBCDIC_Example.java
@@ -1,12 +1,16 @@
1
-import java.nio.charset.Charset;
+import org.slf4j.Logger;
2
+import org.slf4j.LoggerFactory;
3
+import java.nio.charset.Charset;
4
-class Main {
5
+public class EbcdicExample {
6
+ private static final Logger logger = LoggerFactory.getLogger(EbcdicExample.class);
7
+
8
public static void main(String[] args) {
9
// Example: EBCDIC bytes for "ABC" (in Cp037)
10
byte[] ebcdicBytes = new byte[] { (byte)0xC1, (byte)0xC2, (byte)0xC3 };
11
12
// Convert to String using EBCDIC Cp037 charset
13
String text = new String(ebcdicBytes, Charset.forName("Cp037"));
- System.out.println(text);
14
+ logger.info(text);
15
}
-}
16
+}
0 commit comments