From dee9eb4dca2aea04b1f62018b8c1d9cf90da713e Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Mon, 9 Nov 2015 00:04:31 +0200 Subject: [PATCH] a version of code points strings and encodings are definitely not the same for mir and opal the code point version works for me with utf16 encoding (on my machine?) utf16 is sensible choice though may go with it --- lib/debugger.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/debugger.rb b/lib/debugger.rb index 17041ff..7edc15c 100644 --- a/lib/debugger.rb +++ b/lib/debugger.rb @@ -20,6 +20,21 @@ require "views/instruction_view" require "views/registers_view" class Bignum end +class String + def codepoints + arr = [] + one = nil + self.each_byte do |c| + if( one ) + arr << (one + c * 256) + one = nil + else + one = c + end + end + arr + end +end class MainView < ListView include AST::Sexp