# FreeBSD and accented characters



## Juh924 (May 21, 2011)

Hello everybody,

First of all I'm a completely new user in FreeBSD. (And I've also never used Linux before). So here is my problem: It concerns the French accents on the FreeBSD console. I didn't know where else I could post this message because it doesn't concern directly X.

Here are the changes I made:

/etc/rc.conf:

```
font8x8=iso15-font8x8
font8x14=iso15-font8x14
font8x16=iso15-font8x16
```

/etc/login.conf in the default section, I added:

```
:charset=UTF-8:\
:lang=en_US.UTF-8:
```
and then:
[CMD="sudo cap_mkdb /etc/login.conf"][/CMD]

I use hal for X, and everything is configured according to the FreeBSD handbook, using UTF-8. I also use the NVIDIA driver so I did make sure that no "keyboard lines" weren't commented in /etc/X11/xorg.conf

Ok, so I rebooted the system just to make sure everything was launched correctly. The accented characters are working fine in the login screen. 
-> However, once logged, they don't work anymore. I started X to see how it was, and it worked very well. On awesome, on Firefox title bar, accented characters were also displayed. (and even in the CTRL+R window (to start programs in awesome wm) )

Here is a second attempt to make it work on X AND in the console:

/etc/login.conf in the default section, I added:

```
:charset=UTF-8:\
:lang=en_US.ISO-8859-15:
```
and then:
[CMD="sudo cap_mkdb /etc/login.conf"][/CMD]

Then accented characters were working in the console. However, when starting X the Firefox title bar couldn't display accented characters anymore but some strange letters such as ... well I can't write it but it couldn't display the "Ã©Ã¨Ã " etc.

Do you have any ideas to make this work? (I'd like to keep the en_US version by the way.)

Thank you very much,

PS: I tested a lot of combinations after searching on the internet, without success.


----------



## SirDice (May 21, 2011)

Have a look in the handbook: Chapter 23 Localization - I18N/L10N Usage and Setup


----------



## Pantu (May 21, 2011)

You can try the following:

[cmd=]export LANG=<LANG_WHICH_HAS_ACCENTED_CHARS>.UTF-8[/cmd]
and then from the same console start firefox.

Sometimes localization is pretty fu&&ed up, if it is not for US people xD


----------



## Juh924 (May 24, 2011)

Thanks very much.

I tried this solution but it's still not working.

What I don't understand is that:

* In console mode, with the ISO8859-15, accented characters are displayed correctly.
* In X mode, with ISO8859-15 or UTF-8 in .../hal/fdi/policy/x11-input, accented characters work everywhere except in the Firefox title-bar and in the awesome wm "Run" command.
* When using UTF-8 in /etc/login.conf, EVERYTHING (even Firefox title bar and awesome wm run command) is working fine in X mode, except accented characters in console mode.

=> So why when using anything but UTF-8 in /etc/login.conf, there is a problem in the Firefox title bar and in the awesome wm Run command only?

I really can't figure it out, even after reading the handbook. If there are some French members, could you please tell me exactly how you did it?

Thank you very much.


----------



## NicoM (May 27, 2011)

Hi,
In your /etc/login_conf, I suppose you could change


```
:lang=en_US.ISO-8859-15:
```

to


```
:lang=fr_FR.ISO-8859-15:
```


----------



## Juh924 (May 28, 2011)

Hi, thanks.

I already tried this. However I'd like to keep FreeBSD in English. But anyway, where there is ISO8859-15, everything works fine except in X mode, using firefox. When using UTF-8 (no matter what language is used), everything works fine in X mode, even firefox title bar. But in console mode, the "Ã©" displays a /351. And I really can't understand why.

I forgot to mention something: when configured with UTF-8, when typing accented characters in Awesome wm Run command, even if everything appears correctly in X mode, here is what appears in the console:


```
W: awesome: draw_text_context_init:nnn: cannot parse pango markup: Error on line n char nn: Invalid UTF-8 encoded text in name
```
n = numbers I don't remember.

Thanks a lot for your help.


----------



## jrm@ (May 28, 2011)

What is the output of `% locale`?


----------



## Juh924 (May 28, 2011)

Hello,

Well, I've just discovered that Firefox title bar and Awesome WM Run command aren't the only problem I have. The vi editor doesn't display the accented characters either.

Here is what I have in vi when typing 
	
	



```
" Ã© ": \xc3\xa9
```

Here we go:

[CMD=]locale[/cmd]

```
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=
```

Here are all the modifications I made:

In /usr/local/etc/hal/fdi/policy/x11-input.fdi:
I did a copy/paste from FreeBSD handbook, using UTF-8 encoding. (without copying the line with "pc102" as I'm on a laptop.)

In /etc/X11/xorg.conf:
I deleted all the lines referring to the keyboard, lines that were added by nvidia-settings command.

In /etc/rc.conf:

```
keymap="fr.iso.acc"
font8x8="iso15-8x8"
font8x14="iso15-8x14"
font8x16="iso15-8x16"
hald_enable="YES"
dbus_enable="YES"
```

In /etc/login.conf:

```
default: \
...
...
...
:charset=UTF-8: \
:lang=en_US.UTF-8:
```

From here, accented characters are displayed everywhere in X mode (xterm, firefox, firefox title bar, Awesome WM Run command), except when using vi editor. 

In console mode, accented characters aren't displayed at all. Instead of the "Ã©", there is a /351.

I don't know how to post the output of the console, so if somebody could help me out, thank you. (Is there a command like dmesg to print the output of the console in the X mode?)

As UTF-8 isn't supported by the console, I tried to change the /etc/login.conf as follows:

```
default: \
...
...
...
:charset=UTF-8: \
:lang=en_US.ISO8859-15:
```

Now, in console mode, accented characters are working fine. In X mode, accented characters are also displayed in Firefox, xterm, vi editor EXCEPT on the Firefox title bar, and in the Awesome WM Run command.

Even when using fr_FR.UTF-8 or fr_FR.ISO8859-15, the problem is still the same.

Thanks a lot for your help.

PS: the space between : and \ is to avoid FreeBSD smiley and is not an error.


----------



## Juh924 (May 28, 2011)

I forgot something:
When lang=en_US.ISO8859 in /etc/login.conf, the output of [CMD=">"]locale[/CMD] is the same as before, except that instead of UTF-8 there is ISO8859-15.


----------

