senyo Posted October 29, 2009 Share Posted October 29, 2009 I found this script that replaces diacritics, but if I use a string instead of text it replaces most of the characters but two of them still show. $title = "ţ,ă,â,ş,î,Ţ,Ă,Â,Ş,Î"; $search = explode(",","ţ,ă,â,ş,î,Ţ,Ă,Â,Ş,Î"); $replace =explode(",","t,a,a,s,i,T,A,A,S,I"); $urlTitle = str_replace($search, $replace, $title); If $title = $str; â and î don't get replaced, but if $title = "ţ,ă,â,ş,î,Ţ,Ă,Â,Ş,Î"; they get replaced Link to comment https://forums.phpfreaks.com/topic/179528-removing-diacritic-characters/ Share on other sites More sharing options...
senyo Posted October 29, 2009 Author Share Posted October 29, 2009 I think that is a problem with the utf-8 character encoder $new=mb_convert_encoding($str,"HTML-ENTITIES","utf-8"); because if $str= "ţ,ă,â,ş,î,Ţ,Ă,Â,Ş,Î"; all the characters get replaced Link to comment https://forums.phpfreaks.com/topic/179528-removing-diacritic-characters/#findComment-947302 Share on other sites More sharing options...
lemmin Posted October 29, 2009 Share Posted October 29, 2009 Those characters not getting replaced are probably not in your list. They might look the same, but could still be different code values. Try copying and pasting them into the list with respective replacements. Link to comment https://forums.phpfreaks.com/topic/179528-removing-diacritic-characters/#findComment-947306 Share on other sites More sharing options...
senyo Posted October 29, 2009 Author Share Posted October 29, 2009 they are the same characters, this is strange Link to comment https://forums.phpfreaks.com/topic/179528-removing-diacritic-characters/#findComment-947310 Share on other sites More sharing options...
lemmin Posted October 29, 2009 Share Posted October 29, 2009 What editor are you using? It might be changing your characters. You might need to use the codes to detect them. Link to comment https://forums.phpfreaks.com/topic/179528-removing-diacritic-characters/#findComment-947321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.