url_title and apostrophe |
I noticed that the url_title fonction does not convert apostrophes (single quotes) to dash (or underscore).
French apostrophe is the same character as single quote. For example : "L'apostrophe" should be slugifyed as "l-apostrophe" Currently, single quotes are removed and not converted to separators (L'apostrophe → lapostrophe). I would like to update the url_title function, but I'm not familiar with regex. Could someone help me to update the function so that it converts single quotes into dash. PHP Code: // url_helper.php - line 493
URL Helper ain't an expert on foreign characters, but convert_accented_characters() are.
url_title(convert_accented_characters('L'apostrophe')); https://www.codeigniter.com/user_guide/h...characters Can't seem to find it, so you need to add it in your application/config/foreign_chars.php '/L\'/' => 'L-', (11-02-2018, 12:10 AM)jreklund Wrote: URL Helper ain't an expert on foreign characters, but convert_accented_characters() are. That's interesting. The problem is that, in French, apostrophe can be associated to many characters, for example :
PHP Code: '/\'/' => ' ',
No, not really.
I would make a function like this: PHP Code: function french_url_title($str,$seperator='-',$lowercase=FALSE) { |
Welcome Guest, Not a member yet? Register Sign In |