Index: update.rb =================================================================== --- update.rb (revision 97) +++ update.rb (working copy) @@ -1,11 +1,11 @@ -#!/usr/bin/env ruby +#!/usr/local/bin/ruby1.9 --encoding=EUC-JP # # update.rb $Revision: 1.21 $ # # Copyright (C) 2001-2003, TADA Tadashi # You can redistribute it and/or modify it under GPL2. # -BEGIN { $defout.binmode } +BEGIN { $stdout.binmode } $KCODE = 'n' begin @@ -55,7 +55,7 @@ 'status' => '200 OK', 'type' => 'text/html', 'charset' => conf.mobile_encoding, - 'Content-Length' => body.size.to_s, + 'Content-Length' => body.bytesize.to_s, 'Vary' => 'User-Agent' ) else @@ -64,11 +64,12 @@ 'status' => '200 OK', 'type' => 'text/html', 'charset' => conf.encoding, - 'Content-Length' => body.size.to_s, + 'Content-Length' => body.bytesize.to_s, 'Vary' => 'User-Agent' ) end print head + body.force_encoding('ASCII-8BIT') print body if /HEAD/i !~ @cgi.request_method rescue TDiary::ForceRedirect head = { Index: index.rb =================================================================== --- index.rb (revision 97) +++ index.rb (working copy) @@ -1,11 +1,12 @@ -#!/usr/bin/env ruby +#!/usr/local/bin/ruby1.9 --encoding=EUC-JP + # # index.rb $Revision: 1.35 $ # # Copyright (C) 2001-2006, TADA Tadashi # You can redistribute it and/or modify it under GPL2. # -BEGIN { $defout.binmode } +BEGIN { $stdout.binmode } $KCODE = 'n' begin @@ -68,7 +69,7 @@ if @cgi.mobile_agent? then body = conf.to_mobile( tdiary.eval_rhtml( 'i.' ) ) head['charset'] = conf.mobile_encoding - head['Content-Length'] = body.size.to_s + head['Content-Length'] = body.bytesize.to_s else require 'digest/md5' body = tdiary.eval_rhtml @@ -78,13 +79,14 @@ body = '' else head['charset'] = conf.encoding - head['Content-Length'] = body.size.to_s + head['Content-Length'] = body.bytesize.to_s end head['Pragma'] = 'no-cache' head['Cache-Control'] = 'no-cache' end head['cookie'] = tdiary.cookies if tdiary.cookies.size > 0 print @cgi.header( head ) + body.force_encoding('ASCII-8BIT') print body end rescue TDiary::ForceRedirect @@ -93,6 +95,7 @@ 'type' => 'text/html', } head['cookie'] = tdiary.cookies if tdiary.cookies.size > 0 + head.each {|k,v| v.force_encoding('ASCII-8BIT') } print @cgi.header( head ) print %Q[ Index: tdiary.rb =================================================================== --- tdiary.rb (revision 97) +++ tdiary.rb (working copy) @@ -11,6 +11,7 @@ $:.insert( 1, File::dirname( __FILE__ ) + '/misc/lib' ) +require 'compatible' require 'cgi' require 'uri' begin @@ -466,6 +467,7 @@ load instance_variables.each do |v| + v = v.to_s v.sub!( /@/, '' ) instance_eval( <<-SRC def #{v} @@ -626,6 +628,16 @@ :show_referer, :no_referer2, :only_volatile2, :referer_table2, :options2, ] + # compatibile for ruby 1.9 + html_title = author_name = author_mail = index_page = hour_offset = nil + description = icon = banner = nil + header = footer = nil + section_anchor = comment_anchor = date_format = latest_limit = show_nyear = nil + theme = css = nil + show_comment = comment_limit = comment_limit_per_day = nil + mail_on_comment = mail_header = nil + show_referer = no_referer2 = only_volatile2 = referer_table2 = nil + options2 = nil begin cgi_conf = File::open( "#{@data_path}tdiary.conf" ){|f| f.read } cgi_conf.untaint unless @secure Index: plugin/00default.rb =================================================================== --- plugin/00default.rb (revision 97) +++ plugin/00default.rb (working copy) @@ -612,7 +612,7 @@ mail_header = (@conf['comment_mail.header'] || '').dup mail_header << ":#{@conf.date_format}" unless /%[a-zA-Z%]/ =~ mail_header mail_header = @date.strftime( mail_header ) - mail_header = comment_mail_mime( @conf.to_mail( mail_header ) ).join( "\n " ) if /[\x80-\xff]/ =~ mail_header + # mail_header = comment_mail_mime( @conf.to_mail( mail_header ) ).join( "\n " ) if /[\x80-\xff]/ =~ mail_header rmail = '' begin Index: plugin/ja/05referer.rb =================================================================== --- plugin/ja/05referer.rb (revision 97) +++ plugin/ja/05referer.rb (working copy) @@ -31,7 +31,7 @@

既存設定はこちら

#{label_referer_table}

- #{"

リンク元リストのURLを、特定の文字列に変換する対応表を指定できます。1件につき、URLと表示文字列を空白で区切って指定します。正規表現が使えるので、URL中に現れた「(〜)」は、置換文字列中で「\\1」のような「\数字」で利用できます。

" unless @conf.mobile_agent?} + #{"

リンク元リストのURLを、特定の文字列に変換する対応表を指定できます。1件につき、URLと表示文字列を空白で区切って指定します。正規表現が使えるので、URL中に現れた「(〜)」は、置換文字列中で「\\\\1」のような「\\数字」で利用できます。

" unless @conf.mobile_agent?}

既存設定はこちら

HTML