Hello, I was using rhtml files in Windows-1257 encoding in my Rails 1.1.6 application, when I switched to 1.2rc1 (RAILS_GEM_VERSION ''1.1.6.5618'') I started getting strange errors ("...unterminated string meets end of file (SyntaxError), parse error", "...unexpected $, expecting kEND" and so on). When I converted all files to utf-8, everything started working OK, but my problem is that I''m using MS SQL Server database where data is stored in Windows-1257 encoding so when I set headers[''Content-Type''] = "text/html; charset=utf-8" all the text I get from db has strange characters. How can fix this? How can I change default Rails encoding? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
This thread might help you, Domas: http://groups-beta.google.com/group/rubyonrails-talk/browse_thread/thread/5e3d1a4479ecaa56/b8a6f0f4fe46056c?lnk=gst&q=unterminated&rnum=1#b8a6f0f4fe46056c Good luck! Dave On Nov 30, 6:02 am, "Domas Savickas" <dsavic...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > I was using rhtml files in Windows-1257 encoding in my Rails 1.1.6 > application, when I switched to 1.2rc1 (RAILS_GEM_VERSION > ''1.1.6.5618'') I started getting strange errors ("...unterminated > string meets end of file (SyntaxError), parse error", "...unexpected > $, expecting kEND" and so on). > When I converted all files to utf-8, everything started working OK, > but my problem is that I''m using MS SQL Server database where data is > stored in Windows-1257 encoding so when I set > headers[''Content-Type''] = "text/html; charset=utf-8" > all the text I get from db has strange characters. > How can fix this? How can I change default Rails encoding?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for hint. I tried setting: ActionController::Base.default_charset = ''windows-1257'' in environment.rb, but this didin''t help. Domas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
OK, found the solution. I just set $KCODE = ''N'' in environment.rb. So full solution: $KCODE = ''N'' ActionController::Base.default_charset = ''windows-1257'' --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---