# encoding: UTF-8 def show_problem @lang_hash = {'lid1'=> %Q(élan 勢い Schwung импульс)} # I'm using a hash because it's what I use in my plugin... @dlg2 = UI::WebDialog.new("Problem_Main", false,"main_prob", 700, 500, 600, 0, false) html = %Q( Problem_Main

Tested using Sketchup.version #{Sketchup.version}

Tested on #{RUBY_PLATFORM =~ /(darwin)/ ? ((%x(sw_vers).sub(/ProductName:/,'').sub(/ProductVersion:/,'').sub(/BuildVersion:/,'_'))) : %x[ver]}

click into the box and hit return or change to use another non ASCII-8BIT string...

below is the return using 'get_element_value'

below is the return using 'add_action_callback'

) @dlg2.set_html html RUBY_PLATFORM =~ /(darwin)/ ? @dlg2.show_modal() : @dlg2.show() @dlg2.add_action_callback("trans_L8") {|dialog, params| param_id = params.split(',')[0].to_s param_val = params.split(',')[1].gsub('/',"\\").to_s callback = 'return using add_action_callback ' puts callback p(params) elm_val = (@dlg2.get_element_value(param_id)).gsub('/',"\\").to_s element_value = 'return using get_element_value => ' + elm_val puts element_value @dlg2.execute_script("translation1.innerText='#{elm_val}'") @dlg2.execute_script("translation2.innerText='#{param_val}'") } end show_problem # load("/Users/johns_iMac/Library/Application Support/SketchUp 2014/SketchUp/Plugins/jcb_ViewPortResize/dev/show_encoding_issue.rb") # load("[add your path]/show_encoding_issue.rb")