2

I am working on US Drivers License string. I get that string from manatee scanning sdk

The license string starts with format @\n\x001E\rANSI 63601... while encoding it to json (json encoding is done internally by spring framework) the special character \x001E gets stripped resulting in string something like this @\n\rANSI 63601

I tried to ASCII encode license string first by doing:

LicenseString = new String(LicenseString.getBytes(), "ASCII");

this does preserves \x001E but strips \n \r chars

resulting in string something like this @\x001eANSI 630601...

Can somebody guide me what am i doing wrong?

P.S: double escaping special chars etc is not an option for me here.

EDIT

I am working in Android Studio and i am storing the string @\n\x001E\rANSI 63601... in a Java String object

Umair
  • 400
  • 5
  • 19
  • What you are calling a string doesn't look like text. Perhaps a Java or JavaScript `String` isn't the best datatype for it. They are both counted sequences of UTF-16 code units. "\x100E" is [not legal](http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.6) in Java and an escaped ␐ followed by "0E" in JavaScript. Please [edit] in a clarification. – Tom Blodget Mar 08 '17 at 20:39
  • @TomBlodget Made the edit. The data i am storing in string is returned by license scanning sdk in a `Java String` object. – Umair Mar 09 '17 at 10:49

0 Answers0