ruby - Why is the default encoding in Rails not UTF-8? -
when use utf-8 characters (most of time turkish characters) in controllers, have add #encoding: utf-8
on top of each controller file. why doesn't rails use default?
edit: have learnt not rails, ruby.
ruby 2.0 utf8 default. otherwise must signify in 1.9. according naruse:
the default script encoding change.
default script encoding (when magic comment not specified) changed utf8[#6679] in ruby 1.9, default script encoding us-ascii. changed utf-8 after considering following pros , cons. utf-8 default convenient because majority of modern application uses utf-8 change doe not impact 1.9 codes if magic comments in place. default script encoding in 1.9 without magic comment either us-ascii or ascii-8bit. in utf-8, string manipulation become slower.
source: rubyist magazine
Comments
Post a Comment