Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-08-03 20:44:56

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

wcz_utf8_url - native unicode urls

Summary

wcz_utf8_url – uses UTF-8 permlinks instead of transliterated ones for SEO

Features

  • automatically handles non ASCII characters
  • integrated function for updating all of your existing titles – backup first!!!, use on your OWN risk —> <txp:update_urls />
  • works with German, Russian, Ukrainian (on live sites)
  • tested with Japanese, Farsi, Arabic

Version history:
0.1.7 - fixed error with right-to-left languages
0.1.6 - Minor fix autodetect charset in mb_strlower
0.1.5 - Minor fix for mb_strlower and charset
0.1.4 - minor fix of preserving already existing dashes/minuses
0.1.3 - added remove small words
0.1.2 - minor fixes with double dashes and trimming the url string
0.1.1 - minor fixes
0.1.0 - initial release

Requirements

Tested with:

  • Textpattern 4.4.1 – 4.5.7, MySQL 5.1.49, PHP 5.3.3 (Debian Squeeze)

Download & Installation

  1. Download wcz_utf_url and install it in the usual way.
  2. Adjust Textpattern->Advanced Options->“Maximum URL length (in characters)” to your needs.

Source

Git repository: https://github.com/wcz-txp/Unicode-url-for-Textpattern

Bugs & Limitations

Let me know if you find any problems.

To do

  • make list of “small words” a parameter

Feedback

Comments are welcome.

Credits

Big thanks to Gocom, see this thread

Last edited by whocarez (2016-01-18 09:29:59)

Offline

#2 2015-02-08 16:53:48

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 276

Re: wcz_utf8_url - native unicode urls

Hi, i tried that with Asian languages (Arabic, Persian,etc…) but It’s not working ! it become something ??????????????? on the URL , could u plz help me. tnx

Offline

#3 2015-03-30 16:47:41

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

Re: wcz_utf8_url - native unicode urls

I found a problem, that I can’t solve myself.
The register_callback isn’t used, when I edit an alread saved article.

register_callback('wcz_utf8_url','sanitize_for_url');

I played a little bit around with adding options like $step or $pre, but couldn’t find a solution. I tried it on a fresh installation but no success.
Do I have to register another callback?

The problem raminrahimi reported here, is linked to right-to-left languages. So the url transformations aren’t working.

Offline

#4 2015-03-30 19:16:19

juanjonavarro
Plugin Author
From: Valencia, Spain
Registered: 2005-05-16
Posts: 485
Website

Re: wcz_utf8_url - native unicode urls

Have you declared the right plugin type? I think you must declare it being of type 5 (“Admin + Public (+AJAX)”) to support the new AJAX calls when you modify an article.

Offline

#5 2015-03-30 19:32:20

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

Re: wcz_utf8_url - native unicode urls

Thanks a lot!! That helped. New version in first post, if someone is interested.

Offline

Board footer

Powered by FluxBB