![]() |
| | LinkBack | Thread Tools | Display Modes |
| [SOLVED] Mangled accents in the 'link_title' field of the 'links' table Hello, I am using Beta 9.7 (07.09.2007) since yesterday with default template. I am quite amazed how fast one can get a smooth Pligg site up and running - it seems like much work has already gone into this code. I still have to understand how to get "UrlMethod 2" to work, but I'm sure I'm the thousandth newby who will soon figure it out after digging the forums a bit... What I currently can't figure out is why my accented characters are mangled when a link title is stored in the 'link_title' field of the 'links' table. For example, "é" and "ç" are stored wrong. I set up a first Pligg test site at #b^2 links / Published News to play with it. You can see examples of my problem at #b^2 links - Détournement de mobilier urbain pour un sondage (notice the mangled "é") and at #b^2 links - Chez moi ça marche (notice the mangled "ç"). In both cases the page is graphically fine but the URL is wrong, respectively http://infotain.ruwenzori.net/out.ph...our_un_sondage and http://infotain.ruwenzori.net/out.ph...%BF%BDa_marche in the above mentioned examples. I started my database with utf8_unicode_ci and then tried with utf8_general_ci but that does not change anything. Since the database record itself is mangled, I guessed after reading a few threads that the answer may have something to do with libs/utils.php. I found that "é" and "ç" were both missing from the list of "$output = str_replace" character replacements around line 260 of libs/utils.php. Can that be the cause of my problem ? I am the only French user who encountered that specific problem ? Has anybody figured what "$output = str_replace" lines should be added to support titles in the French language ? |
| Sponsored Links |
|
Check out the New Modules at the Pligg Pro Shop.
|
| ||||
| Quote:
But then more grepping led me to discover that this function is used in templates/yget/submit_step_3.tpl at line 58 to sanitize the title so that it can be used in the story's URL : PHP Code: PHP Code: Now, can anyone add that in the dev tree ? Last edited by liotier : 07-25-2007 at 01:02 PM. Reason: Typo |
| The Following User Says Thank You to liotier For This Useful Post: | ||
| ||||
| I forgot one... You may add the following to the list : PHP Code:
__________________ Jean-Marc Liotier |
| ||||
| Great job loitier! Here are ALL the characters necessary for German / Turkish / Norwegian / Dutch / etc: Code: $output = str_replace("ì", "i", $output);
$output = str_replace("í", "i", $output);
$output = str_replace("î", "i", $output);
$output = str_replace("ï", "i", $output);
$output = str_replace("Ì", "I", $output);
$output = str_replace("Í", "I", $output);
$output = str_replace("Î", "I", $output);
$output = str_replace("Ï", "I", $output);
$output = str_replace("ò", "o", $output);
$output = str_replace("ó", "o", $output);
$output = str_replace("ô", "o", $output);
$output = str_replace("õ", "o", $output);
$output = str_replace("ö", "o", $output);
$output = str_replace("ø", "o", $output);
$output = str_replace("Ò", "O", $output);
$output = str_replace("Ó", "O", $output);
$output = str_replace("Ô", "O", $output);
$output = str_replace("Õ", "O", $output);
$output = str_replace("Ö", "O", $output);
$output = str_replace("Ø", "O", $output);
$output = str_replace("ù", "u", $output);
$output = str_replace("ú", "u", $output);
$output = str_replace("û", "u", $output);
$output = str_replace("ü", "u", $output);
$output = str_replace("Ù", "U", $output);
$output = str_replace("Ú", "U", $output);
$output = str_replace("Û", "U", $output);
$output = str_replace("Ü", "U", $output);
$output = str_replace("é", "e", $output);
$output = str_replace("è", "e", $output);
$output = str_replace("ê", "e", $output);
$output = str_replace("ë", "e", $output);
$output = str_replace("È", "E", $output);
$output = str_replace("É", "E", $output);
$output = str_replace("Ê", "E", $output);
$output = str_replace("Ë", "E", $output);
$output = str_replace("à", "a", $output);
$output = str_replace("á", "a", $output);
$output = str_replace("â", "a", $output);
$output = str_replace("ã", "a", $output);
$output = str_replace("ä", "a", $output);
$output = str_replace("å", "a", $output);
$output = str_replace("À", "A", $output);
$output = str_replace("Á", "A", $output);
$output = str_replace("Â", "A", $output);
$output = str_replace("Ã", "A", $output);
$output = str_replace("Ä", "A", $output);
$output = str_replace("Å", "A", $output);
$output = str_replace("ñ", "n", $output);
$output = str_replace("Ñ", "N", $output);
$output = str_replace("æ", "ae", $output);
$output = str_replace("Æ", "AE", $output);
$output = str_replace("ß", "ss", $output);
$output = str_replace("ç", "e", $output);
$output = str_replace("Ç", "C", $output);
$output = str_replace("ý", "y", $output);
$output = str_replace("ÿ", "y", $output);
$output = str_replace("Ý", "Y", $output);
__________________ Like my work? Donations are welcome if you would like to support my work! Finger pliggin' good sites of mine: receptencocktail.nl / numarketing.nl / goboz.com Last edited by beatniak : 08-02-2007 at 04:50 AM. Reason: added the capitals as well |
| The Following User Says Thank You to beatniak For This Useful Post: | ||
| |||
| Okay, but how would one go about it with Chinese characters? |
| ||||
| I spotted an error in Beatniak's list : $output = str_replace("ç", "e", $output); is wrong and should be $output = str_replace("ç", "c", $output);
__________________ Jean-Marc Liotier |
| ||||
| lol - I never saw it that deep - I even copied and used it on one of my sites - now fixing it.
__________________ Get the latest Pligg nightly - updated daily and packed as an archive | Help to translate Pligg to other language Meme or Lame Magazine - a top rated niche site that sends more traffic - citizen media for Gizmophiles Have a Mobile phone try Dollars 5 Complete software to make your mobile complete |
| |||
| From what I saw, before registering a title into your db, you're replacing your accents with non-accents letters ... that's not what you really want to do ... no? actually, what you do with str_replace is to search for é and replace it with e, so in a title, you get ORGINAL : Un avion est écrasé AFTER STR_REPLACE : Un avion est ecrase what I'm searching, is to register the title exactly as it is, no changes, with all the accents. |
| ||||
| Quote:
__________________ Jean-Marc Liotier |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Table 'pligg.table_prefixconfig' doesn't exist | guarriman | Installation and Upgrade Help | 2 | 02-08-2007 02:37 PM |
| Upgrading problem | GurillaNET | Installation and Upgrade Help | 4 | 01-19-2007 09:56 AM |
| Table not getting created | webdevil2003 | Installation and Upgrade Help | 1 | 11-30-2006 07:54 PM |
| Creating the links table with InnoDB | gilshwartz | Bug Report | 0 | 05-23-2006 02:08 PM |
| beta 5 and 6 install but can not create table links | mtmdali | Installation and Upgrade Help | 0 | 01-20-2006 01:21 AM |





Linear Mode

