Recipe 21 | Equalizing Incompatible Characters with normalize() |
Task
Imagine having a cooking application, and you want to add a feature to sort recipes based on the cooking method. The code you developed performs well in sorting recipes for methods like steaming and grilling. However, when it comes to sautéing, the code fails to recognize certain recipes.
After investigating the problem, you realize that the code sometimes fails to match the word “sautéing” even though the characters appear to be the same:
| // Notice the length of the strings |
“é” in method has a code point of U+00E9, while “é” in keyword ...
Get Text Processing with JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.