Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: islandzI am trying to remove accented characters and replace them with their corresponding non-accented character. I am trying the following:
<field>.str()..regexSubstitute("����","e").regexSu bstitute("������","A").regexSubstitute("�","C").re gexSubstitute("�","D").regexSubstitute("����","E") .regexSubstitute("�","F").regexSubstitute("����"," I").regexSubstitute("�","N").regexSubstitute("���� ��","O").regexSubstitute("�","S").regexSubstitute( "����","U").regexSubstitute("��","Y").regexSubstit ute("�","Z").regexSubstitute("������","a").regexSu bstitute("�","c").regexSubstitute("�","f").regexSu bstitute("����","i").regexSubstitute("�","n").rege xSubstitute("������","o").regexSubstitute("�","s") .regexSubstitute("����","u").regexSubstitute("��", "y").regexSubstitute("�","z")
First, it seems I have to add the str() at the start of the substitution list, or else I get a UTF-8 character error. (Not sure why.) But, this substitution does not need to work in all instances. I do see some situations in which the characters are correctly replaced (� is replaced with C) but other instances where they are not (� remains, and is not replaced with e).
Can anyone see/advise what I am doing wrong?
Thank you in advance