bytecode-viewer icon indicating copy to clipboard operation
bytecode-viewer copied to clipboard

coding error (CP1251 ) directory when using Python27 Krakatau

Open jarilo opened this issue 11 years ago • 8 comments

Bytecode-viewer uses the path to the working file %USERPROFILE%. In Win32, with russian encoding CP1251 this way is: USERPROFILE = C:\Documents and Settings\Администратор Python does not work with the local encoding. The result is here these errors:


Krakatau Copyright (C) 2012-14 Robert Grosse This program is provided as open source under the GNU General Public License. See LICENSE.TXT for more details.

Error:

Traceback (most recent call last): File "C:\Documents and Settings\Администратор.Bytecode-Viewer\krakatau_2\Krakatau-master\decompile.py", line 139, in decompileClass(path, targets, args.out, args.skip) File "C:\Documents and Settings\Администратор.Bytecode-Viewer\krakatau_2\Krakatau-master\decompile.py", line 71, in decompileClass out = script_util.makeWriter(outpath, '.java') File "C:\Documents and Settings\Администратор.Bytecode-Viewer\krakatau_2\Krakatau-master\Krakatau\script_util.py", line 137, in makeWriter return DirectoryWriter(base_path, suffix) File "C:\Documents and Settings\Администратор.Bytecode-Viewer\krakatau_2\Krakatau-master\Krakatau\script_util.py", line 93, in init base_path = base_path.decode('utf8') File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xc0 in position 26: invalid start byte

Exit Value is 1 Bytecode Viewer Version: 2.8.1

java.io.FileNotFoundException: C:\Documents and Settings\Администратор.Bytecode-Viewer\bcv_temp\BtXagATrCEYDwxASrtCoKqulLBeKspAH\ua\com\phlox\radiosleep\AlarmSound.java (Системе не удается найти указанный путь) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(Unknown Source) at java.io.FileReader.(Unknown Source) at me.konloch.kontainer.io.DiskReader.loadAsString(DiskReader.java:63) at the.bytecode.club.bytecodeviewer.decompilers.KrakatauDecompiler.decompileClassNode(KrakatauDecompiler.java:84) at the.bytecode.club.bytecodeviewer.gui.ClassViewer$13.doShit(ClassViewer.java:710) at the.bytecode.club.bytecodeviewer.gui.PaneUpdaterThread.run(PaneUpdaterThread.java:16)


I propose to change the working directory to the current, from which you are running "BytecodeViewer 2.8.1.jar". To ".Bytecode-Viewer\krakatau_2\Krakatau-master" was created in the same folder where the "BytecodeViewer 2.8.1.jar".

jarilo avatar Feb 13 '15 18:02 jarilo

Very interesting, I'll look into this thanks for the report!

Konloch avatar Feb 13 '15 18:02 Konloch

Hello! Very interesting your program BytecodeViewer. If you develop it, then I'll be happy to share their concerns and problems found. For example, to edit a copy of "BytecodeViewer 2.8.1.jar" mode "Smali Editable" on the subject to be removed from the code (const-string v2, "user.home"), substituting (const-string v2, "") and then save the changes - did not work  ;) I'm still very new to programming in java, although the experience of IT I have a lot and I do not understand why again while maintaining query main class? After all, he does not change.

Yes, and offer my apologies for the English language. I use google translator, I myself Russian.

Пятница, 13 февраля 2015, 10:46 -08:00 от "Kalen (Konloch) Kinloch" [email protected]:

Very interesting, I'll look into this thanks for the report! — Reply to this email directly or view it on GitHub .

jarilo avatar Feb 14 '15 16:02 jarilo

The smali editor is more for android APKs

Konloch avatar Feb 14 '15 17:02 Konloch

I know, but editable only 2 modes (Krakatau and Smali Editable). Krakatau I did not work I described why smali stayed but it was not possible to edit quickly BytecodeViewer 2.8.1.jar

jarilo avatar Feb 14 '15 17:02 jarilo

And another question, lead a discussion on where your program is preferable? Here on the forum, or in the mail?

jarilo avatar Feb 14 '15 17:02 jarilo

Email works, we could also talk on Skype if you want. My email is [email protected]

Konloch avatar Feb 14 '15 17:02 Konloch

The answer is looking in the mail.

jarilo avatar Feb 14 '15 18:02 jarilo

Verified this is a Krakatau related issue, please report this to the Krakatau github.

Konloch avatar Feb 22 '15 00:02 Konloch