alfred-workflows icon indicating copy to clipboard operation
alfred-workflows copied to clipboard

[VMWare Control] inventory is encoded in UTF-8 not US-ASCII problem

Open churehill opened this issue 9 years ago • 0 comments

Thank you for the VMWare Control workflow. It is really a productivity improving tool.

When I used vm list command, vmware.rb threw such error:

[ERROR: alfred.workflow.input.scriptfilter] Code 1: vmware.rb:49:in `split': invalid byte sequence in US-ASCII (ArgumentError)
    from vmware.rb:49:in `block in inventory_list'
    from vmware.rb:48:in `each_line'
    from vmware.rb:48:in `inventory_list'
    from vmware.rb:25:in `list'
    from main.rb:11:in `generate'
    from main.rb:22:in `list'
    from main.rb:128:in `<main>'

The inventory file "~/Library/Application\ Support/VMware\ Fusion/vmInventory" actually is encoded in UTF-8.

So the line 45 of vmware.rb should read inventory file with UTF-8 encoding. From:

 inventory = File.open(inventory_path)

To:

inventory = File.open(inventory_path, "r:UTF-8")

Anyway, thanks for this tool, it helps a lot.

churehill avatar Dec 09 '15 06:12 churehill