浏览 3014 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2007-01-24
声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2007-01-25
刚才又单独试了一个WEBrick的脚本:
require 'webrick' include WEBrick #a function stub to start WEBrick def start_WEBrick(config = {}) config.update(:Port => 3000) server = HTTPServer.new(config) yield server if block_given? ['INT', 'TERM'].each do |signal| trap(signal) { server.shutdown } end server.start end class HelloServlet < HTTPServlet::AbstractServlet def do_GET(req, res) res["content-type"] = "text/html; charset=UTF-8" res.body = %{ <html> <body> 天才 </body> </html> } end alias do_POST do_GET end # start_WEBrick do |server| #servlet "/hello" server.mount("/hello", HelloServlet) end 这样的脚本就能正常显示中文了,那同理,Mongrel中的default_content_type的设置也应该在类似的文件编写一下就行,因为我现在已经安装了Mongrel,使用ruby script/server将会自动调用Mongrel,顺着这条道走下去,应该能找到default_content_type |
|
返回顶楼 | |
发表时间:2007-01-26
解决了...原来用export加个NLS_LANG就行了
|
|
返回顶楼 | |