[Geany-Devel] UTF-8 in geany's termina, eg. ș

marius buzea magnetudinbuda at xxxxx
Sat Oct 21 13:49:45 UTC 2017


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                                                                    
 


More information about the Devel mailing list