rails代码中直接用中文的问题

某个controller
def test
@test='你好'
end

test.rhtml中
<%=@test%>

执行的时候报错,如果把中文改成hello,运行正常。

是不是rails在代码里面不直接出现中文?还是要设置什么?

请各位指教,多谢!
[b]问题补充:[/b]
感谢"温柔一刀",不过我没明白,怎么看文件编码?
[b]问题补充:[/b]
感谢‘笨笨狗’,以你的方法吧文件保存成utf-8编码,不过居然报这样的错误:
testchinese_controller.rb:5: syntax error, unexpected kEND, expecting $end

代码如下:
class TestchineseController < ApplicationController
def index
@testchinese='你好'
end
end

哪里end出问题了?失败

看看是不是文件编码错了,rails代码里面是可以直接写中文的

文件保存的时候设置编码为utf8,如果用的是IDE比如radrails,是可以统一设置文件编码的。