Java utilities to perform common sanitization tasks on (user) input, e.g. translate "special symbols" to plain ascii characters.
The most common intended use case is sanitizing input which has been copied and pasted from Microsoft Word before being passed to a system architected in the second millenium of the Common Era.
In your pom.xml:
<dependency>
<groupId>com.github.bordertech.sanitizer</groupId>
<artifactId>sanitizer</artifactId>
<version>1.0.1</version>
</dependency>
Example usage:
String in = "Glass \u00BD full. \u00BC + \u00BE = 1";
System.out.println(Symbols.asciifySymbol(in));
// prints "Glass 1/2 full. 1/4 + 3/4 = 1"
See the unit tests for more examples: SymbolsTest.java
If you wish to build this project you will need Apache Maven installed.
Run these commands to fetch the source and build:
git clone https://github.com/bordertech/java-sanitizer.git
cd java-sanitizer
mvn install