Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is anybody can help me figure out this anoying encoding issue? #290

Open
enponder opened this issue Aug 17, 2022 · 3 comments
Open

Is anybody can help me figure out this anoying encoding issue? #290

enponder opened this issue Aug 17, 2022 · 3 comments

Comments

@enponder
Copy link

The following is my code:

C:\Users\Admin>python -m aeneas.tools.execute_task "F:\a.mp3" "F:\b.txt" "task_language=eng|is_text_type=plain|os_task_file_format=json" output/sonnet.json
[WARN] The default input encoding is not UTF-8.
[WARN] You might want to set 'PYTHONIOENCODING=UTF-8' in your shell.
[WARN] The default output encoding is not UTF-8.
[WARN] You might want to set 'PYTHONIOENCODING=UTF-8' in your shell.
[ERRO] Unable to read file 'F:\a.mp3'
[ERRO] Make sure the file path is written/escaped correctly and that you have read permission on it

Yeah, Maybe you have noted that the fucking warning called UTF-8.
I tried a countless times to solve the fucking "UTF-8" issue, but I alway fail to slove it from modifying the computer registry to modifying environment variables and more. I don't eat or drink for servral days to focusing on fix it and still can't fix it, I'm going to break down now.
Due to this encoding issue, I can't run aeneas on my commandline. Can anybody help me. I will always be greatfull.

@ozdefir
Copy link

ozdefir commented Aug 18, 2022

The UTF-8 warning isn't the problem. I think it's a leftover from Python 2. You can ignore it for now.
Your real problem is about the file locations. If your mp3 and txt files are in a USB disk, maybe they are corrupted. Try copying those files to somewhere in C:, change the command line arguments accordingly and run it again.

@enponder
Copy link
Author

enponder commented Aug 18, 2022

The UTF-8 warning isn't the problem. I think it's a leftover from Python 2. You can ignore it for now. Your real problem is about the file locations. If your mp3 and txt files are in a USB disk, maybe they are corrupted. Try copying those files to somewhere in C:, change the command line arguments accordingly and run it again.

The version I installed is integrated installation. The link is here: https://github.com/sillsdev/aeneas-installer/releases. I think that the file location problem you said is no problem: the audio file and the txt file can normally play, and then the hard drive is a solid state drive plugged into my computer, not a USB disk.
I just copy these file to the the root of C and this version, but it's still receive the same warning. Maybe I should change the aeneas version

@ozdefir
Copy link

ozdefir commented Aug 18, 2022

Then, it might be the backslashes ("\") in the input paths causing the problem. As a workaround, you can try using forward slashes instead, as Windows command line accepts that too :

python -m aeneas.tools.execute_task "F:/a.mp3" "F:/b.txt" "task_language=eng|is_text_type=plain|os_task_file_format=json" output/sonnet.json

I'm not on a Windows machine, so I can't check whether python on Windows handles it correctly. If it doesn't work, another alternative would be to run aeneas from the same folder as the input files and to use relative paths instead of absolute paths:

C:\Users\Admin>F:
F:\>python -m aeneas.tools.execute_task "a.mp3" "b.txt" "task_language=eng|is_text_type=plain|os_task_file_format=json" output/sonnet.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants