Hello,
I would like to share a simple use-case with Geany. Here it is: you go to the Geany's terminal and you list a directory that contains files with names containing 'ș'. It may be that instead of 'ș' you see '??'. For my own use, I have changed vte.c with a call to vte_terminal_set_encoding ( … "UTF-8" … ) and then started Geany with "LANG=C.UTF-8" in the environment, for the result 'ș' being displayed as 'ș'. You can see the sketch of my approach below. If you think this idea is good for Geany, feel free to apply it, into vte.c, for example. :) I would also be happy to make a pull request that would add this change, so that I do not add work for somebody else. (Also, if a pull-request is okay, I would use in it geany code convention, code style, etc.).
Best regards, Marius
geany-1.31/src/vte.c
struct VteFunctions {
…
gboolean ( * vte_terminal_set_encoding ) ( VteTerminal * terminal , const char * codeset , GError * * error ) ;
…
} ;
static gboolean vte_register_symbols(GModule *mod) { … BIND_REQUIRED_SYMBOL(vte_terminal_set_encoding); … }
void vte_apply_user_settings(void) { … if (NULL != (vf->vte_terminal_set_encoding) ) {
gboolean ignoredTmpAux = vf->vte_terminal_set_encoding ( VTE_TERMINAL(vc->vte) , "UTF-8" , NULL ) ;
(void) ignoredTmpAux;
} … }
In GNU Bash:
$ export LANG=C.UTF-8 $ cd ~/geany-1.31/usr/bin $ ./geany
Hi Marius,
Le 21/10/2017 à 06:49, marius buzea a écrit :
I would like to share a simple use-case with Geany. Here it is: you go to the Geany's terminal and you list a directory that contains files with names containing 'ș'. It may be that instead of 'ș' you see '??'.
That's very odd, because I've never seen this problem, and use UTF-8 characters occasionally (I'm French and we do have é, è, ê, ô, etc.) and have never ever seen this problem. I just tested with Geany with LANG=C.UTF-8 and it does work just fine.
You might see a problem if the encoding of one of the locale environment variables is not properly set to UTF-8: e.g. if I set LANG=C (so not specifying the encoding) I do see what you mention; but not if I properly set the encoding using LANG=C.UTF-8.
What is the output of `env | grep -E '^(LC|LANG)'`? If any of those variables doesn't properly have an encoding set it might be the reason.
Regards, Colomban