diff options
Diffstat (limited to 'charset.rb')
-rw-r--r-- | charset.rb | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -4,10 +4,10 @@ # see License # ################################ -$utfcookie = CGI::Cookie.new("utf", "true") -$utfcookie.path = "/" +utfcookie = CGI::Cookie.new("utf", "true") +utfcookie.path = "/" if ($cgi.include?("utf") || $cgi.cookies["utf"][0]) && !$cgi.include?("ascii") - $utfcookie.expires = Time.now+1*60*60*24*365 + utfcookie.expires = Time.now+1*60*60*24*365 UTFASCII = "<a href='?ascii' style='text-decoration:none'>Change Charset to plain ASCII</a>" YES = CGI.escapeHTML('✔') @@ -23,7 +23,7 @@ if ($cgi.include?("utf") || $cgi.cookies["utf"][0]) && !$cgi.include?("ascii") EDIT = CGI.escapeHTML("✍") DELETE = CGI.escapeHTML("⌧") else - $utfcookie.expires = Time.now-1*60*60*24*36 + utfcookie.expires = Time.now-1*60*60*24*36 UTFASCII = "<a href='?utf' style='text-decoration:none'>If you see all these characters: #{CGI.escapeHTML('✔✘?–↞←→↠✍⌧')} you can safely change the charset to UTF-8</a>" YES = CGI.escapeHTML('OK') @@ -39,4 +39,4 @@ else EDIT = CGI.escapeHTML("edit") DELETE = CGI.escapeHTML("delete") end - +$header["cookie"] = utfcookie |