{"id":10674,"date":"2021-04-21T10:15:08","date_gmt":"2021-04-21T04:45:08","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=10674"},"modified":"2021-06-14T15:57:00","modified_gmt":"2021-06-14T10:27:00","slug":"remove-unicode-characters-python","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/","title":{"rendered":"5 Solid Ways to Remove Unicode Characters in Python"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#Introduction\" >Introduction<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#What_are_Unicode_characters\" >What are Unicode characters?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#Examples_to_remove_Unicode_characters\" >Examples to remove Unicode characters<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#1_Using_encode_and_decode_method\" >1. Using encode() and decode() method<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#2_Using_replace_method_to_remove_Unicode_characters\" >2. Using replace() method to remove Unicode characters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#3_Using_characterisalnum_method_to_remove_special_characters_in_Python\" >3. Using character.isalnum() method to remove special characters in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#4_Using_regular_expression_to_remove_specific_Unicode_characters_in_Python\" >4. Using regular expression to remove specific Unicode characters in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#5_Using_ord_method_and_for_loop_to_remove_Unicode_characters_in_Python\" >5. Using ord() method and for loop to remove Unicode characters in Python<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-introduction\"><span class=\"ez-toc-section\" id=\"Introduction\"><\/span>Introduction<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In python, we have discussed many concepts and conversions. But sometimes, we come to a situation where we need to remove the Unicode characters from the string. In this tutorial, we will be discussing how to <strong>remove all the Unicode characters <\/strong>from the string in python. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-are-unicode-characters\"><span class=\"ez-toc-section\" id=\"What_are_Unicode_characters\"><\/span>What are Unicode characters?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>Unicode is an international encoding standard that is widely spread and has its acceptance all over the world.<\/strong> It is used with different languages and scripts by which each letter, digit, or symbol is assigned with a unique numeric value that applies across different platforms and programs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-examples-to-remove-unicode-characters\"><span class=\"ez-toc-section\" id=\"Examples_to_remove_Unicode_characters\"><\/span>Examples to remove Unicode characters<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here, we will be discussing all the different ways through which we can remove all the Unicode characters from the string:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-1-using-encode-and-decode-method\"><span class=\"ez-toc-section\" id=\"1_Using_encode_and_decode_method\"><\/span>1. Using encode() and decode() method<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this example, we will be using the encode() function and the decode() function from removing the Unicode characters from the String. <a href=\"https:\/\/docs.python.org\/3\/library\/codecs.html\" target=\"_blank\" rel=\"noreferrer noopener\">Encode() function<\/a> will encode the string into &#8216;ASCII&#8217; and error as &#8216;ignore&#8217; to remove Unicode characters. Decode() function will then decode the string back in its form. Let us look at the example for understanding the concept in detail.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#input string\nstr = &quot;This is Python \\u500cPool&quot;\n\n#encode() method\nstrencode = str.encode(&quot;ascii&quot;, &quot;ignore&quot;)\n\n#decode() method\nstrdecode = strencode.decode()\n\n#output\nprint(&quot;Output after removing Unicode characters : &quot;,strdecode)\n<\/pre><\/div>\n\n\n<p class=\"has-medium-font-size\"><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"799\" height=\"76\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/1-1.png\" alt=\"Using encode() and decode() method\" class=\"wp-image-10681\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/1-1.png 799w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/1-1-300x29.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/1-1-768x73.png 768w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, we will take an input string in the variable named str.<\/li><li>Then, we will apply the encode() method, which will encode the string into &#8216;ASCII&#8217; and error as &#8216;ignore&#8217; to remove Unicode characters.<\/li><li>After that, we will apply the decode() method, which will convert the byte string into the normal string format.<\/li><li>At last, we will print the output.<\/li><li>Hence, you can see the output string with all the removed Unicode characters.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-using-replace-method-to-remove-unicode-characters\"><span class=\"ez-toc-section\" id=\"2_Using_replace_method_to_remove_Unicode_characters\"><\/span>2. Using replace() method to remove Unicode characters<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this example, we will be using replace() method for removing the Unicode characters from the string. Suppose you need to remove the particular Unicode character from the string, so you use the <strong>string.replace()<\/strong> method, which will remove the particular character from the string. Let us look at the example for understanding the concept in detail.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#input string\nstr = &quot;This is Python \\u300cPool&quot;\n\n#replace() method\nstrreplaced = str.replace('\\u300c', '')\n\n#output\nprint(&quot;Output after removing Unicode characters : &quot;,strreplaced)\n<\/pre><\/div>\n\n\n<p class=\"has-medium-font-size\"><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"799\" height=\"76\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/1.png\" alt=\"Using replace() method to remove Unicode characters\" class=\"wp-image-10680\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/1.png 799w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/1-300x29.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/1-768x73.png 768w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, we will take an input string in the variable named str.<\/li><li>Then, we will apply the replace() method in which we will replace the particular Unicode character with the empty space.<\/li><li>At last, we will print the output.<\/li><li>Hence, you can see the output string with all the removed Unicode characters.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-using-character-isalnum-method-to-remove-special-characters-in-python\"><span class=\"ez-toc-section\" id=\"3_Using_characterisalnum_method_to_remove_special_characters_in_Python\"><\/span>3. Using character.isalnum() method to remove special characters in Python<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this example, we will be using the character.isalnum() method to remove the special characters from the string. Suppose we encounter a string in which we have the presence of slash or whitespaces or question marks. So, all these special characters can be removed with the help of the given method. Let us look at the example for understanding the concept in detail.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n&lt;pre class=&quot;wp-block-syntaxhighlighter-code&quot;&gt;#input string\nstr = &quot;This is \/i !? &lt;a href=&quot;http:\/\/www.pythonpool.com\/&quot; target=&quot;_blank&quot; rel=&quot;noreferrer noopener&quot;&gt;Python pool&lt;\/a&gt; tutorial?&quot;&quot;\noutput = &quot;&quot;\nfor character in str:\n    if character.isalnum():\n        output += character\nprint(output)&lt;\/pre&gt;\n<\/pre><\/div>\n\n\n<p class=\"has-medium-font-size\"><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"604\" height=\"70\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/3.png\" alt=\"Using character.isalnum() method to remove special characters\" class=\"wp-image-10679\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/3.png 604w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/3-300x35.png 300w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, we will take an input string in the variable named str.<\/li><li>Then, we will take an empty string with the variable named output.<\/li><li>After that, we will apply for loop from the first character to the last of the string.<\/li><li>Then, we will check the if condition and append the character in the empty string.<\/li><li>This process will continue until the last character in the string occurs.<\/li><li>At last, we will print the output.<\/li><li>Hence, you can see the output with all the special characters and white spaces removed from the string.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-4-using-regular-expression-to-remove-specific-unicode-characters-in-python\"><span class=\"ez-toc-section\" id=\"4_Using_regular_expression_to_remove_specific_Unicode_characters_in_Python\"><\/span>4. Using regular expression to remove specific Unicode characters in Python<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this example, we will be using the regular expression (re.sub() method) for removing the specific Unicode character from the string. This method contains three parameters in it, i.e., pattern, replace, and string. Let us look at the example for understanding the concept in detail.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#import re module\nimport re\n\n#input string\nstr = &quot;Py\u00e9thon\u00f2 Po\u00f2ol!&quot;\n\n#re.sub() method\nOutput = re.sub(r&quot;(\\xe9|\\362)&quot;, &quot;&quot;, str)\n\n#output\nprint(&quot;Removing specific charcater : &quot;,Output)\n<\/pre><\/div>\n\n\n<p class=\"has-medium-font-size\"><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"690\" height=\"61\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/4.png\" alt=\"Using regular expression to remove specific Unicode character in Python\" class=\"wp-image-10678\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/4.png 690w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/4-300x27.png 300w\" sizes=\"(max-width: 690px) 100vw, 690px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, we will import the re module.<\/li><li>Then, we will take an input string in the variable named str.<\/li><li>Then, we will apply the re.sub() method for removing the specific characters from the string and store the output in the Output variable.<\/li><li>At last, we will print the output.<\/li><li>Hence, you will see the output as the specific character removed from the string.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-5-using-ord-method-and-for-loop-to-remove-unicode-characters-in-python\"><span class=\"ez-toc-section\" id=\"5_Using_ord_method_and_for_loop_to_remove_Unicode_characters_in_Python\"><\/span>5. Using ord() method and for loop to remove Unicode characters in Python <span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this example, we will be using the <a href=\"http:\/\/www.pythonpool.com\/python-ord\/\" target=\"_blank\" rel=\"noreferrer noopener\">ord() method<\/a> and a for loop for removing the Unicode characters from the string. <a href=\"http:\/\/www.pythonpool.com\/python-ord\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ord() method<\/a> accepts the string of length 1 as an argument and is used to return the Unicode code point representation of the passed argument. Let us look at the example for understanding the concept in detail.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#input string\nstr = &quot;This is Python \\u500cPool&quot;\n\n#ord() function\noutput = ''.join(&#x5B;i if ord(i) &lt; 128 else ' ' for i in str])\n\n#output\nprint(&quot;After removing Unicode character : &quot;,output)\n<\/pre><\/div>\n\n\n<p class=\"has-medium-font-size\"><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"843\" height=\"65\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/5.png\" alt=\"Using ord() method\" class=\"wp-image-10677\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/5.png 843w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/5-300x23.png 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/5-768x59.png 768w\" sizes=\"(max-width: 843px) 100vw, 843px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Eplanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, we will take an input string in the variable named str.<\/li><li>Then, we will apply the join() function inside which we have applied the <a href=\"http:\/\/www.pythonpool.com\/python-ord\/\" target=\"_blank\" rel=\"noreferrer noopener\">ord() method<\/a> and for loop and store the output in the output variable.<\/li><li>At last, we have printed the output.<\/li><li>Hence, you can see the output as the Unicode characters are removed from the string.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this tutorial, we have learned about the concept of removing the Unicode characters from the string. We have discussed all the ways through which we can remove the Unicode characters from the string. All the ways are explained in detail with the help of examples. You can use any of the functions according to your choice and your requirement in the program.<\/p>\n\n\n\n<p>However, if you have any doubts or questions, do let me know in the comment section below. I will try to help you as soon as possible.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In python, we have discussed many concepts and conversions. But sometimes, we come to a situation where we need to remove the Unicode characters &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"5 Solid Ways to Remove Unicode Characters in Python\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#more-10674\" aria-label=\"More on 5 Solid Ways to Remove Unicode Characters in Python\">Read more<\/a><\/p>\n","protected":false},"author":17,"featured_media":10711,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[15],"tags":[3873,3874,3875,3872],"class_list":["post-10674","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-how-to-remove-unicode-characters-from-a-string-in-python","tag-how-to-remove-unicode-characters-in-python","tag-python-remove-unicode-characters","tag-python-string-unicode-remove-non-english-characters","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v25.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>5 Solid Ways to Remove Unicode Characters in Python - Python Pool<\/title>\n<meta name=\"description\" content=\"We can remove the Unicode characters from the string in Python with the help of methods like encode() and decode(), ord((), replace(), islanum()\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"5 Solid Ways to Remove Unicode Characters in Python\" \/>\n<meta property=\"og:description\" content=\"Introduction In python, we have discussed many concepts and conversions. But sometimes, we come to a situation where we need to remove the Unicode\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-21T04:45:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-14T10:27:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/Solid-Ways-to-Remove-Unicode-Characters-in-Python.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1350\" \/>\n\t<meta property=\"og:image:height\" content=\"650\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Siddharth Jain\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Siddharth Jain\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/\"},\"author\":{\"name\":\"Siddharth Jain\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/75a3240fabe5ea90200777a9d8d3b4fa\"},\"headline\":\"5 Solid Ways to Remove Unicode Characters in Python\",\"datePublished\":\"2021-04-21T04:45:08+00:00\",\"dateModified\":\"2021-06-14T10:27:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/\"},\"wordCount\":906,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/Solid-Ways-to-Remove-Unicode-Characters-in-Python.jpg\",\"keywords\":[\"how to remove unicode characters from a string in python\",\"how to remove unicode characters in python\",\"python remove unicode characters\",\"python string unicode remove non-english characters\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/\",\"url\":\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/\",\"name\":\"5 Solid Ways to Remove Unicode Characters in Python - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/Solid-Ways-to-Remove-Unicode-Characters-in-Python.jpg\",\"datePublished\":\"2021-04-21T04:45:08+00:00\",\"dateModified\":\"2021-06-14T10:27:00+00:00\",\"description\":\"We can remove the Unicode characters from the string in Python with the help of methods like encode() and decode(), ord((), replace(), islanum()\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/Solid-Ways-to-Remove-Unicode-Characters-in-Python.jpg\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/Solid-Ways-to-Remove-Unicode-Characters-in-Python.jpg\",\"width\":1350,\"height\":650,\"caption\":\"remove unicode characters python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"5 Solid Ways to Remove Unicode Characters in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pythonpool.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pythonpool.com\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/pythonpool\",\"https:\/\/www.youtube.com\/c\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/75a3240fabe5ea90200777a9d8d3b4fa\",\"name\":\"Siddharth Jain\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/152b0ac2e5fa2e6328f374499fff4a7a6299477b9cf7bbb15ebc01a88f8f673f?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/152b0ac2e5fa2e6328f374499fff4a7a6299477b9cf7bbb15ebc01a88f8f673f?s=96&d=wavatar&r=g\",\"caption\":\"Siddharth Jain\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"5 Solid Ways to Remove Unicode Characters in Python - Python Pool","description":"We can remove the Unicode characters from the string in Python with the help of methods like encode() and decode(), ord((), replace(), islanum()","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/","og_locale":"en_US","og_type":"article","og_title":"5 Solid Ways to Remove Unicode Characters in Python","og_description":"Introduction In python, we have discussed many concepts and conversions. But sometimes, we come to a situation where we need to remove the Unicode","og_url":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/","og_site_name":"Python Pool","article_published_time":"2021-04-21T04:45:08+00:00","article_modified_time":"2021-06-14T10:27:00+00:00","og_image":[{"width":1350,"height":650,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/Solid-Ways-to-Remove-Unicode-Characters-in-Python.jpg","type":"image\/jpeg"}],"author":"Siddharth Jain","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Siddharth Jain","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/"},"author":{"name":"Siddharth Jain","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/75a3240fabe5ea90200777a9d8d3b4fa"},"headline":"5 Solid Ways to Remove Unicode Characters in Python","datePublished":"2021-04-21T04:45:08+00:00","dateModified":"2021-06-14T10:27:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/"},"wordCount":906,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/Solid-Ways-to-Remove-Unicode-Characters-in-Python.jpg","keywords":["how to remove unicode characters from a string in python","how to remove unicode characters in python","python remove unicode characters","python string unicode remove non-english characters"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/","url":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/","name":"5 Solid Ways to Remove Unicode Characters in Python - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/Solid-Ways-to-Remove-Unicode-Characters-in-Python.jpg","datePublished":"2021-04-21T04:45:08+00:00","dateModified":"2021-06-14T10:27:00+00:00","description":"We can remove the Unicode characters from the string in Python with the help of methods like encode() and decode(), ord((), replace(), islanum()","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/Solid-Ways-to-Remove-Unicode-Characters-in-Python.jpg","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/04\/Solid-Ways-to-Remove-Unicode-Characters-in-Python.jpg","width":1350,"height":650,"caption":"remove unicode characters python"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/remove-unicode-characters-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"5 Solid Ways to Remove Unicode Characters in Python"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/75a3240fabe5ea90200777a9d8d3b4fa","name":"Siddharth Jain","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/152b0ac2e5fa2e6328f374499fff4a7a6299477b9cf7bbb15ebc01a88f8f673f?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/152b0ac2e5fa2e6328f374499fff4a7a6299477b9cf7bbb15ebc01a88f8f673f?s=96&d=wavatar&r=g","caption":"Siddharth Jain"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/10674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=10674"}],"version-history":[{"count":11,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/10674\/revisions"}],"predecessor-version":[{"id":13595,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/10674\/revisions\/13595"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/10711"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=10674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=10674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=10674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}