About special characters remplacement

phpBB3 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting forums and topic titles in their URLs.

Moderator: Moderators

About special characters remplacement

Postby Lubor » Mon Jun 04, 2007 3:49 pm

I have big problem,I am Slovak and some term he shows amiss.Allowing category is Začiatočníci also is it za-iato-nici-
http://linux.sk-net.sk/
my forum

[EDIT] Please read : Custom replacement for title injection

For the new, and easier, method to use to implement custom replacement.
Lubor
PR0
PR0
 
Posts: 52
Joined: Tue Feb 13, 2007 6:37 pm
Location: Slovakia,Bratislava

Advertisement

Postby dcz » Mon Jun 04, 2007 6:02 pm

That's kind of weird č isn't coded as č, since š gives š , but ho well, I guess this is only one more thing that did not get to the mind of w3c.

Anyway, we'll take care of this one separately, should work.
In phpbb_seo_class.php find :

Code: Select all
      $url = htmlentities($url, ENT_COMPAT, $this->encoding);


After add :

Code: Select all
      $url = str_replace( array('č', 'Č'),'c', $url );


++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby Lubor » Mon Jun 04, 2007 6:35 pm

it's no go!
...
Code: Select all
   function format_url( $url, $type = 'topic' ) {
      $url = preg_replace('`\[.*\]`U','',$url);
      $url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$url);
      $url = htmlentities($url, ENT_COMPAT, $this->encoding);
      $url = str_replace( array('č', 'Č'),'c', $url );
      $url = preg_replace( '`&([a-z]+)(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i',"\\1", $url );
      $url = preg_replace( array('`[^a-z0-9]`i','`[-]+`') , '-', $url);
      $url = trim($url, '-');
      $url = ( empty($url) ) ? $type : strtolower($url);
      return $url;
   }

...
:?
Lubor
PR0
PR0
 
Posts: 52
Joined: Tue Feb 13, 2007 6:37 pm
Location: Slovakia,Bratislava

Postby dcz » Mon Jun 04, 2007 6:50 pm

Did you use the htmlentitie code '& #269;' and '& #268;' without the spaces between & and # ?

If not enough, try adding this line before :

Code: Select all
$url = htmlentities($url, ENT_COMPAT, $this->encoding);

Or even before :

Code: Select all
$url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$url);

These char-set things can really get tricky, but in the end, will do ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby Lubor » Tue Jun 05, 2007 5:43 pm

ou,this is interesting :D
Lubor
PR0
PR0
 
Posts: 52
Joined: Tue Feb 13, 2007 6:37 pm
Location: Slovakia,Bratislava

Postby Lubor » Tue Jun 05, 2007 5:47 pm

we are all at sea on this subject,please send me adapted phpbb_seo_class.php ...
Lubor
PR0
PR0
 
Posts: 52
Joined: Tue Feb 13, 2007 6:37 pm
Location: Slovakia,Bratislava

Postby dcz » Wed Jun 06, 2007 9:59 am

?? What do you mean ?

Aren't you the one to be supposed to test my suggestions ?
Did it work ?
I'm sorry, but until you validate this, I won't be able to go further, as I do not run any Slovak installation.

So the line to add is still :
Code: Select all
$url = str_replace( array('č', 'Č'),'c', $url );


But we need to figure out where, eg before :
Code: Select all
$url = htmlentities($url, ENT_COMPAT, $this->encoding);

Or even before :
Code: Select all
$url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$url);


And you'll need as well to test using the numerical entities ('& #269;' and '& #268;' without spaces) in case pasting this line is not enough.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby Lubor » Wed Jun 06, 2007 2:39 pm

omfg,where is problem??? :evil: :evil:

Code: Select all
   function format_url( $url, $type = 'topic' ) {
      $url = preg_replace('`\[.*\]`U','',$url);
      $url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$url);
      $url = str_replace( array('ͥ', 'ͤ'),'c', $url );
      $url = htmlentities($url, ENT_COMPAT, $this->encoding);
      $url = preg_replace( '`&([a-z]+)(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i',"\\1", $url );
      $url = preg_replace( array('`[^a-z0-9]`i','`[-]+`') , '-', $url);
      $url = trim($url, '-');
      $url = ( empty($url) ) ? $type : strtolower($url);
      return $url;
   }

That is bad
Code: Select all
   function format_url( $url, $type = 'topic' ) {
      $url = preg_replace('`\[.*\]`U','',$url);
      $url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$url);
      $url = str_replace( array('č', 'Č'),'c', $url );
      $url = htmlentities($url, ENT_COMPAT, $this->encoding);
      $url = preg_replace( '`&([a-z]+)(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i',"\\1", $url );
      $url = preg_replace( array('`[^a-z0-9]`i','`[-]+`') , '-', $url);
      $url = trim($url, '-');
      $url = ( empty($url) ) ? $type : strtolower($url);
      return $url;
   }

item bad ...
Code: Select all
   function format_url( $url, $type = 'topic' ) {
      $url = preg_replace('`\[.*\]`U','',$url);
      $url = str_replace( array('č', 'Č'),'c', $url );
      $url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$url);
      $url = htmlentities($url, ENT_COMPAT, $this->encoding);
      $url = preg_replace( '`&([a-z]+)(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i',"\\1", $url );
      $url = preg_replace( array('`[^a-z0-9]`i','`[-]+`') , '-', $url);
      $url = trim($url, '-');
      $url = ( empty($url) ) ? $type : strtolower($url);
      return $url;
   }

item
Code: Select all
   function format_url( $url, $type = 'topic' ) {
      $url = preg_replace('`\[.*\]`U','',$url);
      $url = str_replace( array('ͥ', 'ͤ'),'c', $url );
      $url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$url);
      $url = htmlentities($url, ENT_COMPAT, $this->encoding);
      $url = preg_replace( '`&([a-z]+)(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i',"\\1", $url );
      $url = preg_replace( array('`[^a-z0-9]`i','`[-]+`') , '-', $url);
      $url = trim($url, '-');
      $url = ( empty($url) ) ? $type : strtolower($url);
      return $url;
   }
Lubor
PR0
PR0
 
Posts: 52
Joined: Tue Feb 13, 2007 6:37 pm
Location: Slovakia,Bratislava

Postby Lubor » Wed Jun 06, 2007 7:00 pm

whats is new?
Lubor
PR0
PR0
 
Posts: 52
Joined: Tue Feb 13, 2007 6:37 pm
Location: Slovakia,Bratislava

Postby dcz » Wed Jun 06, 2007 9:17 pm

None of these are working ?
If so, I think we only need to past the utf-8 code for č and Č in your case, not the numerical entity.

From the first piece of code you posted, the one showing here the ?, it looks like it went pasted in another char-set than the one handled here, could be utf-8, but it's not this sure.

Try to find example of č and Č in the phpBB3 lang packs, or form an utf-8 editor, and try the same code changes with the characters pasted from there.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby Lubor » Thu Jun 07, 2007 2:18 pm

ou,I test č and Č also either numerical entity.Nix no go ...
:?
Try adding you phpbb_seo_class.php ...
Thank :D
Lubor
PR0
PR0
 
Posts: 52
Joined: Tue Feb 13, 2007 6:37 pm
Location: Slovakia,Bratislava

Postby dcz » Sat Jun 09, 2007 10:56 am

This one is really tricky, I think we need to find out the ascii code for this and filter directly the ascii code, rather than the numerical entity.

So could you search a bit in the phpBB3 Czech language files, to find out how this char is coded in there, and just post here the full line of code where it is used in the language pack.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby Lubor » Sun Jun 10, 2007 3:30 pm

:D ,ASCII?
What shall accomplish?
My English is soft.Could she would are me fair bang as it judge?
Thank :cry:
Lubor
PR0
PR0
 
Posts: 52
Joined: Tue Feb 13, 2007 6:37 pm
Location: Slovakia,Bratislava

Postby dcz » Mon Jun 11, 2007 1:30 pm

Well, I'm just asking your to look in the phpBB3 Czech language files and paste here the full lines of code where a č and Č would be used.

This in order to find out how this is coded, because it's actually quite tricky to find more clues about this particular chars, even with Google ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby Lubor » Mon Jun 11, 2007 3:58 pm

dcz wrote:Well, I'm just asking your to look in the phpBB3 Czech language files and paste here the full lines of code where a č and Č would be used.

This in order to find out how this is coded, because it's actually quite tricky to find more clues about this particular chars, even with Google ;)

++

:evil: :evil: :evil: :evil: :evil:
Code: Select all
   'GROUP_IS_HIDDEN'               => 'Toto je skrytá skupina, iba členovia môžu vidieť dalších členov tejto skupiny.',
Lubor
PR0
PR0
 
Posts: 52
Joined: Tue Feb 13, 2007 6:37 pm
Location: Slovakia,Bratislava

Next

Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: MSN [Bot] and 2 guests