Skip to content

Menu

  • About me
  • my github

tom's blog

some thoughts…

Tag: utf8

normalize UTF8 (translit/deaccent)

March 22, 2009February 16, 2013 by Tom

place this in your application.rb (eg)

Ruby
1
2
3
4
5
class String
  def translit
    Unicode.normalize_KD(self).unpack('U*').select{ |cp| cp < 127 }.pack('U*').gsub(/ /,'-').downcase
  end
end

Posted in programming, ruby/railsTagged programming, rails, ruby, utf8

Tags

advertisement ajeto buffering c++ capacitor cleaning cnc date format dokumenty dovecot dum projekt stavba flowers hardware i18n imaps iPhone linux logo magazine mailserver palm pantyhose phone programming pspdfkit rails repair ruby rubymotion safety seat belt sklo sklárna slackware sportka ssl stavba tls tools trip tulips turbo ultrasound utf8 xinetd

Categories

  • bike (3)
  • cooking (14)
  • embedded (1)
  • flying (8)
    • Heli (2)
    • plastics (3)
  • General (1)
  • hadoop (1)
  • hardware (2)
  • movies (1)
  • můj dům, můj hrad (13)
    • inteligentní dům (5)
      • Foxtrot (1)
    • projekt (1)
    • úředničina (4)
  • mysql (1)
  • nodemcu (2)
  • other stuffs (4)
    • pantyhose (4)
  • photo (15)
  • press (4)
  • programming (63)
    • c++ (1)
    • iPhone (4)
    • logo (msw/fms) (1)
    • lua (3)
    • MCU (2)
    • palm (6)
    • R (2)
    • ruby/rails (27)
    • rubymotion (9)
  • rhino3d (2)
  • Smoothie (1)
  • trips (5)
  • tutorials (7)
    • ruby (7)
  • unix (17)
  • unsortables (30)
  • Vinohrad (1)
Powered by WordPress. Landscape by Diverse Themes.