diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..5c98b42 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/.idea/description.html b/.idea/description.html new file mode 100644 index 0000000..db5f129 --- /dev/null +++ b/.idea/description.html @@ -0,0 +1 @@ +Simple Java application that includes a class with main() method \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..bf392ff --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..697cfd9 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/project-template.xml b/.idea/project-template.xml new file mode 100644 index 0000000..1f08b88 --- /dev/null +++ b/.idea/project-template.xml @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 8f8e79e..5459995 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,13 @@ # StringToUnicodeConverter - +Simple Converter made in Java + +## How to use +1. Download the release and execute the run.bat (on Windows) + +###or + +1. Clone the repo +2. Compile it on your own + +## What did I learn? +* How to convert numbers to Hex diff --git a/StringToUnicodeConverter.iml b/StringToUnicodeConverter.iml new file mode 100644 index 0000000..d5c0743 --- /dev/null +++ b/StringToUnicodeConverter.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/out/production/StringToUnicodeConverter/eu/gebes/writingBot/Main.class b/out/production/StringToUnicodeConverter/eu/gebes/writingBot/Main.class new file mode 100644 index 0000000..c6a232e Binary files /dev/null and b/out/production/StringToUnicodeConverter/eu/gebes/writingBot/Main.class differ diff --git a/out/production/StringToUnicodeConverter/eu/gebes/writingBot/Unicode$Converter.class b/out/production/StringToUnicodeConverter/eu/gebes/writingBot/Unicode$Converter.class new file mode 100644 index 0000000..64b6a1d Binary files /dev/null and b/out/production/StringToUnicodeConverter/eu/gebes/writingBot/Unicode$Converter.class differ diff --git a/out/production/StringToUnicodeConverter/eu/gebes/writingBot/Unicode.class b/out/production/StringToUnicodeConverter/eu/gebes/writingBot/Unicode.class new file mode 100644 index 0000000..4bf7912 Binary files /dev/null and b/out/production/StringToUnicodeConverter/eu/gebes/writingBot/Unicode.class differ diff --git a/src/eu/gebes/writingBot/Main.java b/src/eu/gebes/writingBot/Main.java new file mode 100644 index 0000000..a2d0c46 --- /dev/null +++ b/src/eu/gebes/writingBot/Main.java @@ -0,0 +1,15 @@ +package eu.gebes.writingBot; + +import java.util.Scanner; + +public class Main { + + public static void main(String[] args) { + + Unicode unicode = new Unicode(); + + unicode.execute(); + + + } +} diff --git a/src/eu/gebes/writingBot/Unicode.java b/src/eu/gebes/writingBot/Unicode.java new file mode 100644 index 0000000..6166a4a --- /dev/null +++ b/src/eu/gebes/writingBot/Unicode.java @@ -0,0 +1,52 @@ +package eu.gebes.writingBot; + +import java.util.Scanner; + +public class Unicode { + + static class Converter { + public String charToUnicodeString(char c) { + final String unicode = Integer.toHexString(c).toUpperCase(); + return "U+" + ("0".repeat(4 - unicode.length())) + unicode; + } + } + + public void execute() { + + Converter converter = new Converter(); + + printHeader(); + printLinebreak(); + + boolean exit = false; + while (!exit) { + + System.out.print(" Enter a String to convert in Unicode or press enter to exit\n > "); + String input = new Scanner(System.in).nextLine(); + + + if (input.isEmpty()) { + input = "Bye"; + exit = true; + } + + for (char c : input.toCharArray()) + System.out.println("\t" + c + ": " + converter.charToUnicodeString(c)); + + printLinebreak(); + + } + } + + private void printHeader() { + System.out.println(); + System.out.println("\tUnicodeConverter"); + System.out.println("\t\tv1.0"); + System.out.println(); + } + + private void printLinebreak() { + System.out.println("-" + "=-".repeat(48)); + } + +}