adampresley / sublime-view-in-browser

Open the contents of your current view/tab in a web browser
MIT License
271 stars 68 forks source link

UnicodeEncodeError #73

Open bogkonstantin opened 7 years ago

bogkonstantin commented 7 years ago

Today I have an issue: UnicodeEncodeError: 'ascii' codec can't encode characters in position 56-58: ordinal not in range(128)

Traceback (most recent call last): File "Path to Sublime\sublimeplugin.py", line 818, in run return self.run(edit) File "Path to Sublime\Data\Packages\View In Browser\ViewInBrowserCommand.py", line 202, in run pluginSettings = self.loadPluginSettings(browser) File "Path to Sublime\Data\Packages\View In Browser\ViewInBrowserCommand.py", line 177, in loadPluginSettings result["baseCommand"] = self.getBaseCommand(selectedOs[platform][result["browser"]], osName) File "Path to Sublime\Data\Packages\View In Browser\ViewInBrowserCommand.py", line 85, in getBaseCommand baseCommand = self.expandWindowsUserShellFolder(baseCommand) File "Path to Sublime\Data\Packages\View In Browser\ViewInBrowserCommand.py", line 67, in expandWindowsUserShellFolder windowsFolders = self.getWindowsUserShellFolders() File "Path to Sublime\Data\Packages\View In Browser\ViewInBrowserCommand.py", line 138, in getWindowsUserShellFolders return_dict[name] = value.encode("ascii")

My solution (it works well in my case): In file ViewInBrowserCommand.py", line 138: Change to: return_dict[name] = value.encode("ascii", "ignore")

godlike0108 commented 7 years ago

I have same issue. But there is no ViewInBrowserCommand.py such file in my computer.

Traceback (most recent call last): File "D:\Program Files\Sublime Text 3\sublimeplugin.py", line 812, in run return self.run(edit, **args) File "ViewInBrowserCommand in D:\Program Files\Sublime Text 3\Data\Installed Packages\View In Browser.sublime-package", line 201, in run File "ViewInBrowserCommand in D:\Program Files\Sublime Text 3\Data\Installed Packages\View In Browser.sublime-package", line 176, in loadPluginSettings File "ViewInBrowserCommand in D:\Program Files\Sublime Text 3\Data\Installed Packages\View In Browser.sublime-package", line 85, in getBaseCommand File "ViewInBrowserCommand in D:\Program Files\Sublime Text 3\Data\Installed Packages\View In Browser.sublime-package", line 67, in expandWindowsUserShellFolder File "ViewInBrowserCommand in D:\Program Files\Sublime Text 3\Data\Installed Packages\View In Browser.sublime-package", line 137, in getWindowsUserShellFolders UnicodeEncodeError: 'ascii' codec can't encode characters in position 24-25: ordinal not in range(128)

Need help...

bogkonstantin commented 7 years ago

@godlike0108 use this to extract package files: https://github.com/skuroda/PackageResourceViewer

godlike0108 commented 7 years ago

@bogkonstantin Wow that works! Thanks!!