SketchUp STL String Encoding Issues

Why do you not try to forced the string’s encoding to UTF-8 before doing anything else with it ?
You already do that when setting the extension-loader’s path.

current_path = File.dirname(__FILE__)
if current_path.respond_to?(:force_encoding)
  current_path.force_encoding("UTF-8")
end

But when you do the menu creation you do not.

unless file_loaded?(__FILE__)
  Sketchup.register_importer(CommunityExtensions::STL::Importer.new)
  file_loaded(__FILE__)
end

If you tweak it perhaps as shown below, then does it work ?

if defined?(Encoding)
  me = __FILE__.force_encoding("UTF-8")
else    
  me = __FILE__
end
unless file_loaded?(me)
  Sketchup.register_importer(CommunityExtensions::STL::Importer.new)
  file_loaded(me)
end

Repeat this ‘me’ setup for all similar tests in any of the files using file_loaded ??
OR do NOT pass the whole __FILE__ thus:

begin
  me = File.basename(__FILE__)
  me = "CE_STL_importer" unless me
rescue
  me = "CE_STL_importer"
end
unless file_loaded?(me)
      Sketchup.register_importer(CommunityExtensions::STL::Importer.new)
      file_loaded(me)
end

Or even setting ‘me’ as a simple “string” anyway - thus side stepping the File hiccups and encoding issue entirely.

The file_loaded expects a UTF-8 string, so give it one, one way or another…