mortii / anki-morphs

A MorphMan fork rebuilt from the ground up with a focus on simplicity, performance, and a codebase with minimal technical debt.
https://mortii.github.io/anki-morphs/
Mozilla Public License 2.0
48 stars 6 forks source link

Latin characters causes Mecab spawning to crash on windows #168

Open Kirmassine opened 4 months ago

Kirmassine commented 4 months ago

Good morning, This is my first time installing Ankimorph. I tried to modify the settings from the tools tab, but I am given this error message:

line 139, in spawn_mecab "^bos-feature: (.*)$", str(config_dump, "utf-8"), flags=re.M UnicodeDecodeError: 'utf-8' codec can't decode byte 0xee in position 122: invalid continuation byte

I'm on Windows 11, with Anki version 2.1.50-23.12.1 and the latest Ankimorphs update.

mortii commented 4 months ago

@Kirmassine Thanks for letting me know!

When exactly does the error occur? When you click the 'save' button?

Kirmassine commented 4 months ago

This happens when I press the settings button, in the tools tab. I can't even reach the settings window. Capture d'écran 2024-03-02 111623

mortii commented 4 months ago

@Kirmassine very weird.

Acoording to this site to It looks like byte 0xee is the character î.

The path to the add-on is this on windows:

Windows: C:\Users\[user]\AppData\Roaming\Anki2\[profile_name]

What are the names of your [user] and [profile_name] folders? Do they contain latin characters or some other non-utf8 characters by chance?

Kirmassine commented 4 months ago

My name is Benoît, with an î. If I understand correctly, then this would be a problem due to my name?

mortii commented 4 months ago

My name is Benoît, with an î. If I understand correctly, then this would be a problem due to my name?

Yes. Maybe I can fix it to accept latin characters as well, but I'm not sure if that is possible without making characters from other languages break instead. I'll look into it.

mortii commented 4 months ago

@Kirmassine trying to fix this bug is truly a nightmare since testing it requires a lot of setup.

Could you do me a favor and do the following:

  1. Open up a command prompt and write: chcp
  2. Take a screenshot of the command prompt and upload it here

Thanks!

Kirmassine commented 4 months ago

I don't know much about computers (and I'm bad in english), so I don't know if that's what you're asking. If not, sorry and can you elaborate more on what you want? I absolutely don't mind helping you :)

image

mortii commented 4 months ago

@Kirmassine perfect picture, thank you :+1:

It says C:\Users\TEMP, is that the user you are using Anki on? I expected to see C:\Users\Benoît. Knowing the exact username would help me debug the problem better.

Kirmassine commented 4 months ago

I don't give the same username than before, because I was trying to change it. It didn't work too well at first, but I solved all my problems. The addon works now, just by changing the î to i.

My old username was "C:\Users\lastname Benoît". Since it had my last name, I don't want to give it. But I can tell that there were only alphabetic latin characters, without any particular diacritic (no è, é, ï, î etc.).

mortii commented 4 months ago

I don't give the same username than before, because I was trying to change it. It didn't work too well at first, but I solved all my problems. The addon works now, just by changing the î to i.

@Kirmassine I'm glad you made it work!

My old username was "C:\Users\lastname Benoît". Since it had my last name, I don't want to give it. But I can tell that there were only alphabetic latin characters, without any particular diacritic (no è, é, ï, î etc.).

Ah, I see, completely understandable. Thanks for clarifying and giving me the info I wanted. I'm going to try fixing this bug so people don't have to change their username, but this bug is very specific and very complicated (surprisingly), so it might take a while.

Kirmassine commented 4 months ago

Good luck and thank you for this wonderful addon !