This Question is Resolved.

If you have a similiar issue that this thread does not address, click the button below to open a new related support topic.

 
 
1.6.6 Problem with create_url_title - strtolower is not work correctly with foreign characters in UTF-8
Posted: 02 December 2008 02:43 AM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  43
Joined  01-04-2008

Hello,
If we let the url title blank, EE will attempt to create url from the title.

if ( ! $url_title)
            
{
                $url_title
= strtolower($title);
            
}

There is the problem - strtolower doesn’t work correct with foreign characters. So that when we send the string to foreign_character_conversion function it wouldn’t work.

 Signature 

First Contact
kCaptcha

Profile
 
 
Posted: 02 December 2008 03:01 AM   [ Ignore ]   [ # 1 ]  
Grad Student
Avatar
Rank
Total Posts:  43
Joined  01-04-2008

if (function_exists('mb_convert_encoding'))
        
{
            $url_title
= mb_strtolower($title, ‘UTF-8’);
        
}
        
else
        
{
            $url_title
= strtolower($title);
        
}

How I know, to do solution based on iconv() needs to make addition function (with converts charset).

 Signature 

First Contact
kCaptcha

Profile
 
 
Posted: 02 December 2008 08:29 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23744
Joined  05-20-2002

Thanks for the ‘Heads up’- can you give me a good test title to try it with?  And is it throwing an error for you when it happens?

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 02 December 2008 11:59 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Avatar
Rank
Total Posts:  43
Joined  01-04-2008

title - Tränen der Rührung und seliges Lächeln

no errors - just all no latin symbol(like ä and ü in test title)  convert to “?” and will deleted from url.

But how I understand,  my solution with mb_strtolower will helps only to people with Western Europe languages (Germany, French etc.), because after that we go to create_url_title function where make UTF-8 title encoding to ISO-8859-1. Its means that all symbol what not in this table (like Cyrillic symbol - абвгдежзиклмнопрст) will be convert to “?” and will deleted from url.

 Signature 

First Contact
kCaptcha

Profile
 
 
Posted: 09 December 2008 01:26 PM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23744
Joined  05-20-2002

Sorry this one took a while to polish off as it involved tweaked a number of files.  We moved the lower case conversion to the regex create_url_title function (after the more verbose character conversion done there).

But you’re correct, it’s not always possible to automatically create the url title, in which case it will give an error message and allow you to manually add a url_title.  Where it is possible, the strtolower issue should be resolved for the next build.

Thanks for bringing it to our attention!

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
 

This Question is Resolved.

If you have a similiar issue that this thread does not address, click the button below to open a new related support topic.

 
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66391 Total Logged-in Users: 46
Total Topics: 84715 Total Anonymous Users: 12
Total Replies: 454694 Total Guests: 180
Total Posts: 539409    
Members ( View Memberlist )