Esnyper Posted July 11, 2012 Share Posted July 11, 2012 Hi, when I writing product name or cms page title ą automaticaly converts to a, č to c, ę to e, š to s, ž to z, but other symbols like ė, į, ų, ū - disappears. Maybe someone knows how to add converting to these symbols? Link to comment Share on other sites More sharing options...
Esnyper Posted July 11, 2012 Author Share Posted July 11, 2012 Anybody? Link to comment Share on other sites More sharing options...
Esnyper Posted July 12, 2012 Author Share Posted July 12, 2012 Where can I find this function? Link to comment Share on other sites More sharing options...
Esnyper Posted July 13, 2012 Author Share Posted July 13, 2012 bump Link to comment Share on other sites More sharing options...
Esnyper Posted July 14, 2012 Author Share Posted July 14, 2012 (edited) Found founction wich replace these symbols, added codes, but still not working. What I forget? public static function replaceAccentedChars($str) { $str = preg_replace('/[\x{0105}\x{0104}\x{00E0}\x{00E1}\x{00E2}\x{00E3}\x{00E4}\x{00E5}]/u','a', $str); $str = preg_replace('/[\x{00E7}\x{010D}\x{0107}\x{0106}]/u','c', $str); $str = preg_replace('/[\x{010F}]/u','d', $str); $str = preg_replace('/[\x{00E8}[b]\x{0116}\x{0117}[/b]\x{00E9}\x{00EA}\x{00EB}\x{011B}\x{0119}\x{0118}]/u','e', $str); $str = preg_replace('/[\x{00EC}\x{00ED}\x{00EE}\x{00EF}[b]\x{012F}\x{012E}[/b]]/u','i', $str); $str = preg_replace('/[\x{0142}\x{0141}\x{013E}\x{013A}]/u','l', $str); $str = preg_replace('/[\x{00F1}\x{0148}]/u','n', $str); $str = preg_replace('/[\x{00F2}\x{00F3}\x{00F4}\x{00F5}\x{00F6}\x{00F8}\x{00D3}]/u','o', $str); $str = preg_replace('/[\x{0159}\x{0155}]/u','r', $str); $str = preg_replace('/[\x{015B}\x{015A}\x{0161}]/u','s', $str); $str = preg_replace('/[\x{00DF}]/u','ss', $str); $str = preg_replace('/[\x{0165}]/u','t', $str); $str = preg_replace('/[\x{00F9}\x{00FA}\x{00FB}\x{00FC}\x{016F}[b]\x{0173}\x{0172}\x{016B}\x{016A}[/b]]/u','u', $str); $str = preg_replace('/[\x{00FD}\x{00FF}]/u','y', $str); $str = preg_replace('/[\x{017C}\x{017A}\x{017B}\x{0179}\x{017E}]/u','z', $str); $str = preg_replace('/[\x{00E6}]/u','ae', $str); $str = preg_replace('/[\x{0153}]/u','oe', $str); return $str; } * - added code Edited July 14, 2012 by Esnyper (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now