Ruby method to remove accents from UTF-8 international characters

后端 未结 4 2077
走了就别回头了
走了就别回头了 2020-12-04 15:00

I am trying to create a \'normalized\' copy of a string, to help reduce duplicate names in a database. The names contain many international characters (ie. accented letters)

4条回答
  •  离开以前
    2020-12-04 15:39

    The parameterize method could be a nice and simple solution to remove special characters in order to use the string as human readable identifier:

    > "Françoise Isaïe".parameterize
    => "francoise-isaie"
    

提交回复
热议问题