Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Georgian unicode characters #10

Open
wants to merge 1 commit into from

1 participant

Hello there!

I really like your gem and I'm using it for my current task, which is an organization website.
I live in Georgia (country, not the state), so most articles will have Georgian titles.
So the issue that I have is that your gem replaces all Georgian characters with "", and it means that articles' permalink field will be empty.

And what I did was that I added Georgian language compatibility, so it doesn't replace Georgian unicode characters with "".
I just changed this line in lib/friendly_url.rb:
n.gsub!(/[^\sa-z0-9_-]/, '')
to
n.gsub!(/[^\sa-zა-ჰ0-9_-]/, '')
("ა" and "ჰ" are the first and the last characters of Georgian alphabet).

The reason why I'm making a pull request and not just changing the gem on my local is that I'll need to set up this website on the server and if you pull my changes, it'll make my life easier.

Thanks in advance.

d0ragon closed this
d0ragon reopened this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 14, 2012
d0ragon added Georgian language compatibility, so it doesn't replace Georgian…
… unicode characters with ''.
1458b72
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  lib/friendly_url.rb
2  lib/friendly_url.rb
@@ -28,7 +28,7 @@ def normalize(str)
28 28 n.gsub!(/[ýÿŷ]/, 'y')
29 29 n.gsub!(/[žżź]/, 'z')
30 30 n.gsub!(/\s+/, '-')
31   - n.gsub!(/[^\sa-z0-9_-]/, '')
  31 + n.gsub!(/[^\sa-zა-ჰ0-9_-]/, '')
32 32 n.gsub!(/-{2,}/, '-')
33 33 n.gsub!(/^-/, '')
34 34 n.gsub!(/-$/, '')

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.