Closed ghedamat closed 13 years ago
Sorry for the late response, I was away on holiday.
The problem is that your xterm title is UTF-8 whereas the File.expand_path() call at control/action/launch.yaml:17
is expecting ASCII-8BIT encoding.
Try changing that line into this:
path = File.expand_path(s.encode('ASCII-8BIT'))
No problem.. it's a marginal issue, and surely due to some sort of my fault..
Well.. the error remains the same :)
looking at s.encoding seems that normally the string encoding is US-ASCII but when I open the terminal from skype than the encoding is ASCII-8BIT...
trying to force it to ASCII-8BIT hence does nothing but trying to change it to UTF-8 or something else like US-ASCII rises a conversion error saying charset is incompatible..
??? I'm really a UTF8 noob... any hint is appreciated
thank you anyway for your help :) as usual.. :)
Since encoding conversion is not working, try this:
path = File.expand_path(s) rescue s
it worked! Now i've to discover why! :P
thanks!
The reason I use File.expand_path()
is to take care of ~
in the paths. For example if your currently selected client has the title some_program ~/foo/bar.rb
then Ruby will not be able to File.open("~/foo/bar.rb")
because it does not know what ~ is. We have to do File.open(File.expand_path("~/foo/bar.rb"))
for things to work properly.
In this case, we just give up if the path expansion fails and try to use the raw path instead (that's what the rescue
clause does).
Hope that explains things. Cheers.
yes! I'm used to File.expand_path but didn't know about rescue used like this :)
thanks!
Commit bef08e74da22eca6d8b40a6362224228e8a0e47d really solves this issue.
tested and it works! have to understand why :P but no time right know..
as usual many thanks!
Wel.. i'm here again..
another issue raised up...
i've turned my xterm to utf8+256 colors and something strange happens..
when i'm on a gtk/qt application particularity skype...
I have no idea about that but trying to rise up an xterm with mod4+x as I'm used to causes wmii to crash giving this error...
/home/tha/.wmii/control/action/launch.yaml:control:keyboard_action:launch_terminal:13:in
expand_path' /home/tha/.wmii/control/action/launch.yaml:control:keyboard_action:launch_terminal:13:in
block (4 levels) in control' /home/tha/.wmii/control/action/launch.yaml:control:keyboard_action:launch_terminal:12:inreverse_each' /home/tha/.wmii/control/action/launch.yaml:control:keyboard_action:launch_terminal:12:in
block (3 levels) in control' /home/tha/.wmii/lib/wmiirc/handler.rb:20:incall' /home/tha/.wmii/lib/wmiirc/handler.rb:20:in
block in handle' /home/tha/.wmii/lib/wmiirc/handler.rb:19:ineach' /home/tha/.wmii/lib/wmiirc/handler.rb:19:in
handle' /home/tha/.wmii/lib/wmiirc/handler.rb:73:inkey' /home/tha/.wmii/lib/wmiirc/config.rb:99:in
block (2 levels) in control' /home/tha/.wmii/lib/wmiirc/handler.rb:20:incall' /home/tha/.wmii/lib/wmiirc/handler.rb:20:in
block in handle' /home/tha/.wmii/lib/wmiirc/handler.rb:19:ineach' /home/tha/.wmii/lib/wmiirc/handler.rb:19:in
handle' /home/tha/.wmii/lib/wmiirc/handler.rb:39:inevent' /home/tha/.wmii/lib/wmiirc/loader.rb:94:in
block (2 levels) in enter_event_loop' /home/tha/.wmii/lib/wmiirc/loader.rb:90:ineach' /home/tha/.wmii/lib/wmiirc/loader.rb:90:in
block in enter_event_loop' /usr/local/rvm/gems/ruby-1.9.2-p0/gems/rumai-3.3.1/lib/rumai/fs.rb:105:ineach_line' /usr/local/rvm/gems/ruby-1.9.2-p0/gems/rumai-3.3.1/lib/rumai/fs.rb:105:in
block in each_line'i'm running funtoo linux ruby 1.9.2 with rvm wmii-hg with libixp-hg
thank you very much for your help as usual!
let me know if i can be useful
Mattia