Package se.digg.dgc.transliteration
Class MrzEncoder
- java.lang.Object
-
- se.digg.dgc.transliteration.MrzEncoder
-
public class MrzEncoder extends Object
MRZ name encoder according to ICAO format.- Author:
- Martin Lindström (martin@idsec.se), Henrik Bengtsson (extern.henrik.bengtsson@digg.se), Henric Norlander (extern.henric.norlander@digg.se)
-
-
Field Summary
Fields Modifier and Type Field Description static Map<Character,String>
CHAR_MAPPINGS
Character mappingsstatic int
LENGTH_RESTRICTION
Length restriction.
-
Constructor Summary
Constructors Constructor Description MrzEncoder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
encode(String input)
Encodes the supplied string to a MRZ encoded string.
-
-
-
Field Detail
-
LENGTH_RESTRICTION
public static final int LENGTH_RESTRICTION
Length restriction.- See Also:
- Constant Field Values
-
-
Method Detail
-
encode
public static String encode(String input)
Encodes the supplied string to a MRZ encoded string.This means removing all accents, mapping/expanding characters according to
CHAR_MAPPINGS
, converting the string to uppercase, and finally to replace all spaces and non-supported characters with the '<' char.- Parameters:
input
- the name to encode- Returns:
- the MRZ encoded string
-
-