Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/primefaces/primeng
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Dec 28, 2023
2 parents b2f6896 + 1e9078d commit 964726c
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions src/app/components/utils/objectutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,29 +134,8 @@ export class ObjectUtils {
}

public static removeAccents(str) {
if (str && str.search(/[\xC0-\xFF]/g) > -1) {
str = str
.replace(/[\xC0-\xC5]/g, 'A')
.replace(/[\xC6]/g, 'AE')
.replace(/[\xC7]/g, 'C')
.replace(/[\xC8-\xCB]/g, 'E')
.replace(/[\xCC-\xCF]/g, 'I')
.replace(/[\xD0]/g, 'D')
.replace(/[\xD1]/g, 'N')
.replace(/[\xD2-\xD6\xD8]/g, 'O')
.replace(/[\xD9-\xDC]/g, 'U')
.replace(/[\xDD]/g, 'Y')
.replace(/[\xDE]/g, 'P')
.replace(/[\xE0-\xE5]/g, 'a')
.replace(/[\xE6]/g, 'ae')
.replace(/[\xE7]/g, 'c')
.replace(/[\xE8-\xEB]/g, 'e')
.replace(/[\xEC-\xEF]/g, 'i')
.replace(/[\xF1]/g, 'n')
.replace(/[\xF2-\xF6\xF8]/g, 'o')
.replace(/[\xF9-\xFC]/g, 'u')
.replace(/[\xFE]/g, 'p')
.replace(/[\xFD\xFF]/g, 'y');
if (str) {
str = str.normalize('NFKD').replace(/\p{Diacritic}/gu, '');
}

return str;
Expand Down

0 comments on commit 964726c

Please sign in to comment.