You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unicode file-names not displayed properly in Console #75
@Yaron10 With which version of the plugin. Could you also paste as short example code which triggers this issue. Is it just the displaying of the error message or is it also not possible to use unicode path.
Could you also paste as short example code which triggers this issue.
editor.copy(
Add that line to a file, save it as טסט.py and place it in the scripts folder.
On running it (no problem in this regard), you get the second error shown in the screenshot above: the file-name (טסט.py) is displayed as 84F5~1.py and the path (C:\Program Files\Notepad++\NP\plugins\Config\PythonScript\scripts) is also wrong.
Maybe this could be changed with python 3 (#36), but currently I see no chance to modify that without breaking unicode script filename support from #60.
Also the file link in the console error output is working for me.
Let's keep it open, but currently I see no easy fix based on python 2.7. Maybe some deeper inspection of the python sourcecode gives some hints, if UTF-8 filenames are supported, but from the current checks, tests and internet searches it doesn't look promising that this is possible. Therefore the "workaround" with the windows shortname was chosen.
the input as boost::python:str is UTF8 encoded, but detected as plain string by PyUnicode_Check(). That seems to show it just as encoded version. Need further investigation.
Activity
chcg commentedon Jun 7, 2018
@Yaron10 With which version of the plugin. Could you also paste as short example code which triggers this issue. Is it just the displaying of the error message or is it also not possible to use unicode path.
Yaron10 commentedon Jun 7, 2018
@chcg,
v1.1.0.53.
editor.copy(Add that line to a file, save it as
טסט.pyand place it in thescriptsfolder.On running it (no problem in this regard), you get the second error shown in the screenshot above: the file-name (
טסט.py) is displayed as84F5~1.pyand the path (C:\Program Files\Notepad++\NP\plugins\Config\PythonScript\scripts) is also wrong.Thank you for looking into it. I appreciate it.
chcg commentedon Jun 8, 2018
Unfortunately that is not wrong, but just the short path name (https://msdn.microsoft.com/en-us/library/windows/desktop/aa364989(v=vs.85).aspx) of the file used behind the scenes to access unicode file names/path, because direct input of the unicode name to python api didn't work.
Maybe this could be changed with python 3 (#36), but currently I see no chance to modify that without breaking unicode script filename support from #60.
Also the file link in the console error output is working for me.
Yaron10 commentedon Jun 8, 2018
Thank you for the explanation.
And thanks again for looking into it.
So I suppose this issue shouldn't be closed for the time being.
chcg commentedon Jun 10, 2018
Let's keep it open, but currently I see no easy fix based on python 2.7. Maybe some deeper inspection of the python sourcecode gives some hints, if UTF-8 filenames are supported, but from the current checks, tests and internet searches it doesn't look promising that this is possible. Therefore the "workaround" with the windows shortname was chosen.
Yaron10 commentedon Jun 10, 2018
Thanks again. I appreciate your work.
Allow me another related question.
STR:
Open a file named
טסט.txtin NPP.Run (from the console or in a script)
notepad.getCurrentFilename().Result:

Is that fixable?
Off-topic but still related:
Can I pass
$(FULL_CURRENT_PATH)to a python-script via a command inshortcuts.xml?Thank you.
chcg commentedon Jun 15, 2018
Regarding notepad.getCurrentFilename() and the corresponding result. This seems to be a problem within:
PythonScript/PythonScript/src/PythonConsole.cpp
Lines 188 to 208 in 77a365b
the input as boost::python:str is UTF8 encoded, but detected as plain string by PyUnicode_Check(). That seems to show it just as encoded version. Need further investigation.
Yaron10 commentedon Jun 15, 2018
@chcg,
Thank you for looking into the issue and further investigating it.
chcg commentedon Sep 7, 2020
@Yaron10 I just retested the described issues with the current alpha release https://github.com/bruderstein/PythonScript/releases/tag/v3.0.4 and the issues seems to be fixed with the update to python3 and the changes in the script file loading.
Yaron10 commentedon Sep 7, 2020
@chcg,
Thank you for your work and for updating here. 👍
I'd rather wait a bit before switching to v3.