前提・実現したいこと
Sublime Textで『view in Browser』を試したところエラーが発生しました。
自分的にはエンコードをUTF-8に設定してあればエラーは解消できると思ったのですが,変わらず。
調べてもいい回答が見つからなかったので,質問させて頂きました。
発生している問題・エラーメッセージ
View In Browser plugin v2.0.0, Python 3 Traceback (most recent call last): File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 1088, in run_ return self.run(edit) File "C:\Users\yossi\AppData\Roaming\Sublime Text 3\Installed Packages\View In Browser.sublime-package\ViewInBrowserCommand.py", line 201, in run File "C:\Users\yossi\AppData\Roaming\Sublime Text 3\Installed Packages\View In Browser.sublime-package\ViewInBrowserCommand.py", line 176, in loadPluginSettings File "C:\Users\yossi\AppData\Roaming\Sublime Text 3\Installed Packages\View In Browser.sublime-package\ViewInBrowserCommand.py", line 85, in getBaseCommand File "C:\Users\yossi\AppData\Roaming\Sublime Text 3\Installed Packages\View In Browser.sublime-package\ViewInBrowserCommand.py", line 67, in expandWindowsUserShellFolder File "C:\Users\yossi\AppData\Roaming\Sublime Text 3\Installed Packages\View In Browser.sublime-package\ViewInBrowserCommand.py", line 137, in getWindowsUserShellFolders UnicodeEncodeError: 'ascii' codec can't encode characters in position 24-25: ordinal not in range(128)
該当のソースコード
test.html
HTML
1<!DOCTYPE html> 2<html lang="ja"> 3<head> 4 <meta charset="UTF-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 <title>Document</title> 7</head> 8<body> 9 <h1>AAA</h1> 10</body> 11</html>
試したこと
下記をDefaultとUser両方に設定
{ "posix": { "linux": { "firefox": "firefox -new-tab", "chrome": "google-chrome", "chrome64": "google-chrome", "chromium": "chromium" }, "linux2": { "firefox": "firefox -new-tab", "chrome": "google-chrome", "chrome64": "google-chrome", "chromium": "chromium" }, "darwin": { "firefox": "open -a \"/Applications/Firefox.app\"", "safari": "open -a \"/Applications/Safari.app\"", "chrome": "open -a \"/Applications/Google Chrome.app\"", "chrome64": "open -a \"/Applications/Google Chrome.app\"", "yandex": "open -a \"/Applications/Yandex.app\"" } }, "nt": { "win32": { "firefox": "C:\Program Files\Mozilla Firefox\firefox.exe -new-tab", "iexplore": "C:\Program Files\Internet Explorer\iexplore.exe", "chrome": "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "chrome64": "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "yandex": "%Local AppData%\Yandex\YandexBrowser\browser.exe" } }, "browser": "chrome" }
https://qiita.com/taka_baya/items/591fcbe5af53e66c1ee4
https://teratail.com/questions/109896
https://hodalog.com/about-unicodeencodeerror-using-japanese-in-python-code/
上記を参考にし設定を変更したり,エラー内容でググったり
補足情報(FW/ツールのバージョンなど)
Sublime Text3
windows