{"id":5782,"date":"2012-06-29T18:30:12","date_gmt":"2012-06-29T13:00:12","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=5782"},"modified":"2014-12-17T09:14:34","modified_gmt":"2014-12-17T03:44:34","slug":"normalization-forms-for-accented-characters-in-java","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/","title":{"rendered":"Normalization Forms for Accented Characters in Java"},"content":{"rendered":"<p>Text Normalization is the process of &#8220;standardizing&#8221; text to a certain form, so as to enable, searching, indexing and other types of analytical processing on it. Often working with large quantities of text we encounter character with accents like <strong>\u00e9 , \u00e2 <\/strong>etc. Unicode provides multiple ways to create such characters . For example we can have<strong> \u00e9<\/strong> created using Unicode sequence \\u00E9 (composite character) or we can create it using a combination of e + acute accent. that would be (e + \\u0301).<br \/>\nNow the <strong>\u00e9<\/strong> created would look same in both the representations and would also mean the same thing, but for a java program they are actually not the same characters so the <strong>\u00e9 <\/strong>created using the two methods are actually not equal for your program. Clearly we need to normalize these two different representations to a fixed standard.<\/p>\n<p>And its here, that <strong>java.text.Normalizer <\/strong>class comes to our rescue. All we need to do is normalize things to a normalization form out of these 4 :<\/p>\n<ol>\n<li>NFC \u2013 Canonical Decomposition, followed by Canonical Composition.<\/li>\n<li>NFD \u2013 Canonical Decomposition<\/li>\n<li>NFKC \u2013 Compatibility Decomposition, followed by Canonical Composition<\/li>\n<li>NFKD \u2013 Compatibility Decomposition<\/li>\n<\/ol>\n<p>\n\tCanonical Decomposition means, taking a character and decomposing it into its component characters<\/p>\n<p>\n\tCompatibility decomposition means taking a character and decomposing it by compatibility and arranging them in specific order<br \/>\n<br \/>\n\tCanonical Composition means recomposing characters based on their <strong>canonical equivalence.<\/strong><br \/>\n<br \/>\n<strong>Canonical equivalence <\/strong>further means that characters have the same appearance and meaning when printed or displayed.<br \/>\n<br \/>\nTo Fully summarize this in an example, <br \/>\nConsider, the Angstrom sign <strong>&#8220;\u00c5&#8221;, <\/strong> <strong>(U+212B)<\/strong> and \u00a0the Swedish letter <strong>&#8220;\u00c5&#8221;<\/strong> <strong> (U+00C5), <\/strong> both are expanded by NFD (or NFKD) into <strong>&#8220;A&#8221;<\/strong> and <strong>&#8220;\u00b0&#8221;<\/strong> <strong>(U+0041 and U+030A) <\/strong> which is then reduced by NFC (or NFKC) to the Swedish letter <strong>&#8220;\u00c5&#8221;<\/strong> <strong>(U+00C5) \u00a0(<\/strong>Swedish Letter <strong>&#8220;\u00c5&#8221;<\/strong> is canonically equivalent to Angstrom sign <strong>&#8220;\u00c5&#8221;<\/strong> as they are printed and displayed as exactly same, though they are different<strong>)<\/strong>.<br \/>\n<\/p>\n<p>Now we know how we can normalize unicode characters to a standard form wherever required.<\/p>\n<p>\nSachin Anand<\/p>\n<p>@babasachinanand<\/p>\n<p>sachin[at]intelligrape[dot]com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Text Normalization is the process of &#8220;standardizing&#8221; text to a certain form, so as to enable, searching, indexing and other types of analytical processing on it. Often working with large quantities of text we encounter character with accents like \u00e9 , \u00e2 etc. Unicode provides multiple ways to create such characters . For example we [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":19,"footnotes":""},"categories":[1],"tags":[833,4844,832,834,831],"class_list":["post-5782","post","type-post","status-publish","format-standard","hentry","category-technology","tag-accented-characters","tag-java","tag-normalization-forms","tag-normalize-text","tag-text-normalization"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Text Normalization is the process of &quot;standardizing&quot; text to a certain form, so as to enable, searching, indexing and other types of analytical processing on it. Often working with large quantities of text we encounter character with accents like \u00e9 , \u00e2 etc. Unicode provides multiple ways to create such characters . For example we\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Sachin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Normalization Forms for Accented Characters in Java | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Text Normalization is the process of &quot;standardizing&quot; text to a certain form, so as to enable, searching, indexing and other types of analytical processing on it. Often working with large quantities of text we encounter character with accents like \u00e9 , \u00e2 etc. Unicode provides multiple ways to create such characters . For example we\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Normalization Forms for Accented Characters in Java | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Text Normalization is the process of &quot;standardizing&quot; text to a certain form, so as to enable, searching, indexing and other types of analytical processing on it. Often working with large quantities of text we encounter character with accents like \u00e9 , \u00e2 etc. Unicode provides multiple ways to create such characters . For example we\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/normalization-forms-for-accented-characters-in-java\\\/#article\",\"name\":\"Normalization Forms for Accented Characters in Java | TO THE NEW Blog\",\"headline\":\"Normalization Forms for Accented Characters in Java\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sachin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2012-06-29T18:30:12+05:30\",\"dateModified\":\"2014-12-17T09:14:34+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/normalization-forms-for-accented-characters-in-java\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/normalization-forms-for-accented-characters-in-java\\\/#webpage\"},\"articleSection\":\"Technology, accented characters, Java, normalization forms, normalize text, Text Normalization\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/normalization-forms-for-accented-characters-in-java\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/normalization-forms-for-accented-characters-in-java\\\/#listItem\",\"name\":\"Normalization Forms for Accented Characters in Java\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/normalization-forms-for-accented-characters-in-java\\\/#listItem\",\"position\":3,\"name\":\"Normalization Forms for Accented Characters in Java\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sachin\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sachin\\\/\",\"name\":\"Sachin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/normalization-forms-for-accented-characters-in-java\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d84b0b7a42bd13ad65b8a665e117addb0455be6b706c443a53526dc9d0e5af87?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Sachin\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/normalization-forms-for-accented-characters-in-java\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/normalization-forms-for-accented-characters-in-java\\\/\",\"name\":\"Normalization Forms for Accented Characters in Java | TO THE NEW Blog\",\"description\":\"Text Normalization is the process of \\\"standardizing\\\" text to a certain form, so as to enable, searching, indexing and other types of analytical processing on it. Often working with large quantities of text we encounter character with accents like \\u00e9 , \\u00e2 etc. Unicode provides multiple ways to create such characters . For example we\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/normalization-forms-for-accented-characters-in-java\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sachin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sachin\\\/#author\"},\"datePublished\":\"2012-06-29T18:30:12+05:30\",\"dateModified\":\"2014-12-17T09:14:34+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Normalization Forms for Accented Characters in Java | TO THE NEW Blog","description":"Text Normalization is the process of \"standardizing\" text to a certain form, so as to enable, searching, indexing and other types of analytical processing on it. Often working with large quantities of text we encounter character with accents like \u00e9 , \u00e2 etc. Unicode provides multiple ways to create such characters . For example we","canonical_url":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/#article","name":"Normalization Forms for Accented Characters in Java | TO THE NEW Blog","headline":"Normalization Forms for Accented Characters in Java","author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/sachin\/#author"},"publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"},"datePublished":"2012-06-29T18:30:12+05:30","dateModified":"2014-12-17T09:14:34+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/#webpage"},"isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/#webpage"},"articleSection":"Technology, accented characters, Java, normalization forms, normalize text, Text Normalization"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.tothenew.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/www.tothenew.com\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/#listItem","name":"Normalization Forms for Accented Characters in Java"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/#listItem","position":3,"name":"Normalization Forms for Accented Characters in Java","previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/www.tothenew.com\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/www.tothenew.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.tothenew.com\/blog\/author\/sachin\/#author","url":"https:\/\/www.tothenew.com\/blog\/author\/sachin\/","name":"Sachin","image":{"@type":"ImageObject","@id":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d84b0b7a42bd13ad65b8a665e117addb0455be6b706c443a53526dc9d0e5af87?s=96&d=mm&r=g","width":96,"height":96,"caption":"Sachin"}},{"@type":"WebPage","@id":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/#webpage","url":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/","name":"Normalization Forms for Accented Characters in Java | TO THE NEW Blog","description":"Text Normalization is the process of \"standardizing\" text to a certain form, so as to enable, searching, indexing and other types of analytical processing on it. Often working with large quantities of text we encounter character with accents like \u00e9 , \u00e2 etc. Unicode provides multiple ways to create such characters . For example we","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/#breadcrumblist"},"author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/sachin\/#author"},"creator":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/sachin\/#author"},"datePublished":"2012-06-29T18:30:12+05:30","dateModified":"2014-12-17T09:14:34+05:30"},{"@type":"WebSite","@id":"https:\/\/www.tothenew.com\/blog\/#website","url":"https:\/\/www.tothenew.com\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Normalization Forms for Accented Characters in Java | TO THE NEW Blog","og:description":"Text Normalization is the process of &quot;standardizing&quot; text to a certain form, so as to enable, searching, indexing and other types of analytical processing on it. Often working with large quantities of text we encounter character with accents like \u00e9 , \u00e2 etc. Unicode provides multiple ways to create such characters . For example we","og:url":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/","og:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Normalization Forms for Accented Characters in Java | TO THE NEW Blog","twitter:description":"Text Normalization is the process of &quot;standardizing&quot; text to a certain form, so as to enable, searching, indexing and other types of analytical processing on it. Often working with large quantities of text we encounter character with accents like \u00e9 , \u00e2 etc. Unicode provides multiple ways to create such characters . For example we","twitter:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"5782","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 12:27:51","updated":"2024-02-29 08:36:20","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tNormalization Forms for Accented Characters in Java\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.tothenew.com\/blog"},{"label":"Technology","link":"https:\/\/www.tothenew.com\/blog\/category\/technology\/"},{"label":"Normalization Forms for Accented Characters in Java","link":"https:\/\/www.tothenew.com\/blog\/normalization-forms-for-accented-characters-in-java\/"}],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/5782","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=5782"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/5782\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=5782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=5782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=5782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}