Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support UTF normalization #50

Open
phochste opened this issue Dec 5, 2016 · 1 comment
Open

Support UTF normalization #50

phochste opened this issue Dec 5, 2016 · 1 comment

Comments

@phochste
Copy link
Member

phochste commented Dec 5, 2016

Convert ä as represented by a + ¨ characters' code bytes: [61 cc 88] to UTF-8 character bytes: [c3 a4]

Hint:

 $ uconv -x any-nfc [catmandu output file] > [normalized file]
@jorol
Copy link
Member

jorol commented Dec 7, 2016

There are several characters which could be encoded as precomposed characters or as combining characters. You can use Unicode::Normalize for normalization:

use Unicode::Normalize;

my $nfc = NFC($nfd);

But I recommend to handle this outside of Catmandu with uconv because it's faster for big files:

$ uconv -x any-nfc camel_nfd.mrc | catmandu convert MARC to JSON > camel_nfc.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants