nijel / enca

Extremely Naive Charset Analyser

Home Page:https://cihar.com/software/enca/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

enca: Cannot open locale alias file `/usr/share/locale/locale.alias' in mode r

konstunn opened this issue · comments

This issue is related to mingw-w64-enca package. Please, could you have look and help to make a patch?

Enca cannot open locale alias file for reading, but the file is permitted to be read.

OPERATOR+konstunn@operator MINGW32 ~/mysql-climate-monitor
$ enca -i Unit1.pas
C:\msys32\mingw32\bin\enca.exe: Cannot open file `/usr/share/locale/locale.alias' in mode r: No such file or directory
C:\msys32\mingw32\bin\enca.exe: Cannot determine (or understand) your language preferences.
Please use `-L language', or `-L none' if your language is not supported
(only a few multibyte encodings can be recognized then).
Run `C:\msys32\mingw32\bin\enca.exe --list languages' to get a list of supported languages.

OPERATOR+konstunn@operator MINGW32 ~/mysql-climate-monitor
$ ll /usr/share/locale/locale.alias
-rw-r--r-- 1 OPERATOR+konstunn OPERATOR+Отсутствует 2866 май 15 10:34 /usr/share/locale/locale.alias

Reference: https://github.com/Alexpux/MINGW-packages/issues/1427

Enca really doesn't do anything special here, see https://github.com/nijel/enca/blob/master/src/filebuf.c#L453

Does cat /usr/share/locale/locale.alias work for you?

Yes, cat /usr/share/locale/locale.alias works for me.

I almost sure that the issue is not enca-specific. It's all about porting. Just ask you for help because you might know package configuration structure very well. However, I don't know how msys2 converts paths, deals with them, but I suppose that we should spoof some paths in enca to make it work with msys2. But may be I'm wrong.

IMHO Enca really does nothing special, just fopen("/usr/share/locale/locale.alias", "r").