先日から使用しているエディタScribesで特定のファイルがクラッシュする現象に悩んでいる。
原因がよくわかっていない。
1 2 3 4 5 | $ scribes ivoryworks_201201.txt $ /usr/lib/python2.7/site-packages/SCRIBES/GUI/MainGUI/Buffer/CursorPlacer.py:29: GtkWarning: gtktextiter.c:3818: Incorrect byte offset 42 falls in the middle of a UTF-8 character; this will crash the text buffer. Byte indexes must refer to the start of a character. iterator.set_line_index(index) ** Gtk:ERROR:gtktextsegment.c:196:_gtk_char_segment_new: assertion failed: (gtk_text_byte_begins_utf8_char (text)) |
このファイルは、Dropboxで共有していて、Linux(Edit:Scribes)とAndroid(Edit:Jota Text Editor)で編集しているのだけど、お互いに更新を行い、特定の状況(ファイルの状態)に陥ると上記のようにクラッシュする。
文字コードはUTF-8。
vimやgeditでは特に問題なく開ける。
BOMの有り無しが影響しているのかもしれないと思い、以下の検証をする(この手段で正しく検証できているかどうか自信がない)。
1 2 3 4 5 | $ nkf -s ivoryworks_201201.txt > ivoryworks_201201.txt.shiftjis $ nkf -w ivoryworks_201201.txt.shiftjis > ivoryworks_201201.txt.utf8 $ nkf -w8 ivoryworks_201201.txt.shiftjis > ivoryworks_201201.txt.utf8_BOM $ scribes ivoryworks_201201.txt.utf8 $ scribes ivoryworks_201201.txt.utf8_BOM |
BOMの有り無しに関わらず問題なく開ける。
1 2 3 4 5 6 | $ diff ivoryworks_201201.txt ivoryworks_201201.txt.utf8 $ diff ivoryworks_201201.txt ivoryworks_201201.txt.utf8_BOM 1c1 < 2012/01/15 --- > 2012/01/15 |
ちなみに、Android側で編集した後に発生するかと言えば、必ずしもそうではない。
常用したいので何とか解決したいところ。
Comments are closed.