Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: permalink_fu.rb
- ===================================================================
- --- permalink_fu.rb (revision 261)
- +++ permalink_fu.rb (working copy)
- @@ -1,12 +1,15 @@
- require 'iconv'
- require 'digest/sha1'
- +require 'diacritics_fu'
- +
- module PermalinkFu
- class << self
- attr_accessor :translation_to
- attr_accessor :translation_from
- def escape(str)
- - s = Iconv.iconv(translation_to, translation_from, str).to_s
- + s = DiacriticsFu.escape(str)
- + s = Iconv.iconv(translation_to, translation_from, s).to_s
- s.gsub!(/\W+/, ' ') # all non-word chars to spaces
- s.strip! # ohh la la
- s.downcase! #
Add Comment
Please, Sign In to add comment