Closed PacoCables closed 11 years ago
Could you describe the steps to reproduce this? It's actually a fairly common error.
I experienced this today for the first time. Example log:
root@lacantinajazz:/home/www/repie# diakonos index.php
/usr/lib/ruby/1.9.1/diakonos/core-ext/string.rb:50:in index': invalid byte sequence in UTF-8 (ArgumentError) from /usr/lib/ruby/1.9.1/diakonos/core-ext/string.rb:50:in
block in group_index'
from /usr/lib/ruby/1.9.1/diakonos/core-ext/string.rb:49:in loop' from /usr/lib/ruby/1.9.1/diakonos/core-ext/string.rb:49:in
group_index'
from /usr/lib/ruby/1.9.1/diakonos/buffer/searching.rb:425:in block (2 levels) in seek' from /usr/lib/ruby/1.9.1/diakonos/buffer/searching.rb:424:in
each'
from /usr/lib/ruby/1.9.1/diakonos/buffer/searching.rb:424:in block in seek' from /usr/lib/ruby/1.9.1/diakonos/buffer/searching.rb:410:in
catch'
from /usr/lib/ruby/1.9.1/diakonos/buffer/searching.rb:410:in seek' from /usr/lib/ruby/1.9.1/diakonos/functions/search.rb:160:in
seek'
from /usr/lib/ruby/1.9.1/diakonos.rb:383:in start' from /usr/bin/diakonos:6:in
FWIW: I noticed that diakonos crashes if I type special symbols like the ° symbol. Errors:
/usr/lib/ruby/1.9.1/diakonos/buffer.rb:201:in +': can't convert Fixnum into String (TypeError) from /usr/lib/ruby/1.9.1/diakonos/buffer.rb:201:in
insert_string'
from /usr/lib/ruby/1.9.1/diakonos/keying.rb:412:in type_character' from /usr/lib/ruby/1.9.1/diakonos/keying.rb:286:in
process_keystroke'
from /usr/lib/ruby/1.9.1/diakonos.rb:391:in start' from /usr/bin/diakonos:6:in
@marcovansteen : I'll need a copy of whatever file(s) you're working with that trigger these problems. You could use gist.github.com or something to give them to me.
I was able to paste ° into a new file just now, with no crash.
Hi Pistos, Attached is the text file at which diakonos crashes. I apologize in advance for any bad practices in the code that's in it ;-) Best regards, Marco
PS: my compliments for all the good work that's put in diakonos! it's my number 1 linux command line editor.
2013/8/1 Pistos notifications@github.com
@marcovansteen https://github.com/marcovansteen : I'll need a copy of whatever file(s) you're working with that trigger these problems. You could use gist.github.com or something to give them to me.
I was able to paste ° into a new file just now, with no crash.
— Reply to this email directly or view it on GitHubhttps://github.com/Pistos/diakonos/issues/25#issuecomment-21947691 .
Thank you for the compliment.
Now, as for your file, it did not get sent to github when you replied by email. You'll have to furnish it by going to something like https://gist.github.com/ . Though, if you can put it up on a website somewhere, that would be better, because gist might remove some of the parts of the text that are causing the problem.
Hi Pistos,
I attached the file tst.php to my previous email. Did you miss the attachment? I didn't use gist.github.com because I expect that it does not transfer all details like end-of-line delimiters. Instead the file url is here http://www.repie.nl/tst.txt . For clarity i renamed it from tst.php to tst.txt . With the .txt extension the same problems occur.
Hope this helps.
Best regards, Marco
2013/8/2 Pistos notifications@github.com
Thank you for the compliment.
Now, as for your file, it did not get sent to github when you replied by email. You'll have to furnish it by going to something like https://gist.github.com/ .
— Reply to this email directly or view it on GitHubhttps://github.com/Pistos/diakonos/issues/25#issuecomment-22017852 .
Thank you. I got the file, and I am able to see the error. I will check this out.
Okay, I've investigated this a bit. I admit, I am not very well-versed in character encodings, but it appears your file is in ISO-8859 encoding. You can determine this with the UNIX utility file
. e.g. file tst.txt
I converted your file with iconv:
iconv --from-code=ISO-8859-1 --to-code=UTF-8 tst.txt > tst-utf-8.txt
and then I was able to open the converted file with Diakonos, and it looked the same to me.
I am not willing to make Diakonos support ISO-8859 files at this time, sorry.
Ah OK. Thanks for the help. I will check out why this encoding was used.
cheers!
2013/8/2 Pistos notifications@github.com
Okay, I've investigated this a bit. I admit, I am not very well-versed in character encodings, but it appears your file is in ISO-8859 encoding. You can determine this with the UNIX utility file. e.g. file tst.txt
I converted your file with iconv:
iconv --from-code=ISO-8859-1 --to-code=UTF-8 tst.txt > tst-utf-8.txt
and then I was able to open the converted file with Diakonos, and it looked the same to me.
I am not willing to make Diakonos support ISO-8859 files at this time, sorry.
— Reply to this email directly or view it on GitHubhttps://github.com/Pistos/diakonos/issues/25#issuecomment-22031519 .
Probable Causes:
If you can reproduce this error, please report it at
https://github.com/Pistos/diakonos/issues !
/usr/lib/ruby/1.9.1/diakonos/core-ext/string.rb:14:in
sub!' /usr/lib/ruby/1.9.1/diakonos/core-ext/string.rb:14:in
expand_tabs' /usr/lib/ruby/1.9.1/diakonos/buffer/display.rb:307:inblock in display' /usr/lib/ruby/1.9.1/diakonos/buffer/display.rb:295:in
each' /usr/lib/ruby/1.9.1/diakonos/buffer/display.rb:295:ineach_with_index' /usr/lib/ruby/1.9.1/diakonos/buffer/display.rb:295:in
display' /usr/lib/ruby/1.9.1/diakonos/display.rb:283:in `block in display_buffer'