Right-click Sublime Text 3 -> Open in Browser to open the files contained in the Japanese name folder

Asked 1 years ago, Updated 1 years ago, 113 views

Right-click Sublime Text 3 - > Open in Browser to open the file contained in the folder with the Japanese name.
Currently, when I try to open a file contained in a folder containing Japanese names,

File "open_in_browser in/Applications/Sublime Text.app/Contents/MacOS/Packages/Default.sublime-package", line 7, in run
  File "./webbrowser.py", line 70, inopen_new_tab
  File "./webbrowser.py", line 62, in open
  File "./webbrowser.py", line 635, in open
UnicodeEncodeError: 'ascii' codec can't encode characters in position 45-46: original not in range (128)

appears on the console and does not appear in the browser.
If the file path consists of all half-width alphanumeric characters, open it in the default browser with Open in Browser without any problems.

How can I open the files contained in the folder containing the Japanese name in Open in Browser?
If anyone knows the solution, please let me know.

sublimetext

2022-09-30 14:34

1 Answers

I'm sorry if I'm wrong.
Locate webbrowser.py in the folder containing Sublime Text and look for line 635 .
The function def open(self, url, something...) is declared on top of it, so just below it

 url=url.encode("utf-8")

I think it will be fixed by adding .
バックアップPlease play with me after you back up.


2022-09-30 14:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.