Java comparator for String in EBCDIC encoding -


i have come across requirement need convert string ebcdic encoding , sort it. need sort ebcdic because string has go in mainframe. string sort have alphabets in captial , integers only.

i googled , came across link ibm has listed characters in order

what realized ebcdic sorting opposite normal java lexicographic sorting (at least type of data going process).

my question realization right ? if not missing ? or there java comparator available ebcdic encoding.

since char type implicitly utf-16 in java ebcdic strings need compared java byte arrays.

example:

    charset encoding = charset.forname("ibm1047");     comparator<string> enccomparator = (s1, s2) ->             encoding.encode(s1)                     .compareto(encoding.encode(s2)); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -