Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add support for UTF8 Charset #68

Closed
wants to merge 1 commit into from

1 participant

@brightchimp

Hi,

I have added a command line parameter (-U) that will set the $KCODE variable to UTF8.

The tweet-stream gem, which is a dependency of the latest twitter gem, requires that $KCODE be set to "UTF8".

Cheers
Peter

@brightchimp

Not ready yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 28, 2011
  1. @brightchimp
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 1 deletion.
  1. +6 −1 bin/god
  2. +4 −0 lib/god/cli/run.rb
View
7 bin/god
@@ -19,7 +19,7 @@ begin
opts.banner = <<-EOF
Usage:
Starting:
- god [-c <config file>] [-p <port> | -b] [-P <file>] [-l <file>] [-D]
+ god [-c <config file>] [-p <port> | -b] [-P <file>] [-l <file>] [-D] [-U]
Querying:
god <command> <argument> [-p <port>]
@@ -69,6 +69,11 @@ begin
options[:daemonize] = false
end
+ # The tweet-text gem needs this in ruby < 1.8
+ opts.on("-U", "--utf8-charset", "Use UTF-8 character set (sets $KCODE to UTF8)") do
+ options[:utf8] = true
+ end
+
opts.on("-v", "--version", "Print the version number and exit") do
options[:version] = true
end
View
4 lib/god/cli/run.rb
@@ -16,6 +16,10 @@ def dispatch
require 'god/sys_logger'
end
+ if @options[:utf8]
+ $KCODE = 'UTF8'
+ end
+
# run
if @options[:daemonize]
run_daemonized
Something went wrong with that request. Please try again.