Tag: 记事本++

为Notepad ++添加关键字到Ruby语法高亮显示

我正在尝试添加require并将其include为Notepad ++的Ruby关键字,但我遇到了一些麻烦。 我修改了langs.model.xml文件的ruby语言标记,如下所示: __FILE__ and def end in or self unless __LINE__ begin defined? ensure module redo super until BEGIN break do false next rescue then when END case else for nil retry true while alias class elsif if not return undef yield require include 但是,即使在更新此require ,仍然没有像其他关键字那样突出显示。 有人可以建议吗?

Notepad ++只称为“ANSI”的编码,是否有人知道如何为Ruby调用它?

我有一堆.txt的Notepad ++说(在它的下拉“编码”菜单中)是“ANSI”。 它们中包含德语字符[äöüß],它在Notepad ++中显示得很好。 但是当我在File.read ‘this is a German text example.txt’时,它们并没有显示在irb中。 那么有谁知道我应该给出什么参数Encoding.default_external= ? (我假设这是解决方案,对吗?) 当’utf-8’或’cp850’ ,它会将“äöüß”中的“ANSI”文件读作“\ xE4 \ xF6 \ xFC \ xDF”… (请不要犹豫,在你的答案中提到显而易见的“明显”事物;我几乎和你一样新生,并且仍然知道这个问题就足够了。)