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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -