The Accidental Rubyist

invalid byte sequence in UTF-8

ecto script: inter.rb

leave a comment »

To learn how to do hyperlinking with inter.rb see this.

#!/usr/bin/env ruby
file = ARGV[0];
text =,"r").readlines.join;
urlmap = {"w" => "",
"g" => "",
"dict" => "",
"http" => "http:%s",
"th" => ""
text.gsub!(/\[\[(\w+?):(.+?)\]\]/) { |match|
if path == nil then
puts "%s not found in urlmap" % $1
str = $2.split('|')
if str.size == 1 then
str %s') % [str[0], str[1]]
#puts text, "w").puts text;

Source of inter.rb (Escapes, i.e., \ or \, are disappearing despite all attempts to print them)


Written by totalrecall

February 28, 2007 at 7:00 pm

Posted in ecto, ruby

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: