# Can't have accented characters



## kikinovak (Mar 29, 2010)

Hi,

I just installed FreeBSD 7.3 (canned distribution "All"), and I managed to configure X. TWM comes up fine. I fiddled with various keyboard layouts in xorg.conf (french, german, swiss french), and it sort of works, except I don't have any special characters, e. g. Ã©, Ã , Ã , Ã¶, Ã¤, Ã¼ and the likes. 

I'm a long-time Linux user since Slackware 7.1, but completely new to FreeBSD (nobody's perfect :e). I wonder if there's some additional step to take for having correct special chars, like installing special fonts or the likes. 

One other detail: in the console (where I defined a swiss french keyboard) I don't have accented characters either, but on my main desktop PC (running CentOS Linux 5.4) I do have them in the console.


----------



## Beastie (Mar 29, 2010)

You have to set up a compose key. Execute `% setxkbmap -option compose:rwin` and put it in ~/.xinitrc or similar, so that it's executed every time you start X. Your compose key is now linked to the right "Windows" key.
Do this test: press the compose key, press *"*, press *a*. You should have *Ã¤*. Note that all keys must be pressed and released immediately.
Now have fun with the slash, comma, tilde, grave accent, apostrophe, etc.


----------



## kikinovak (Mar 29, 2010)

Sorry, but this is not a solution. If I follow your advice, I understand that FreeBSD cannot handle swiss/french/german keyboard layouts? I can't quite believe that.


----------



## kikinovak (Mar 30, 2010)

This is curious. Are there no folks using FreeBSD with french, swiss of german keyboard layouts? I got curious and installed PCBSD on a spare machine, and all my different keyboard layouts work here. So the question would be: what do I need on a stock FreeBSD install to have accented characters (in X, and eventually in the console)?


----------



## Beastie (Mar 30, 2010)

`% setxkbmap fr`
`% setxkbmap de`
?


----------



## Daisuke_Aramaki (Mar 30, 2010)

I am happily using a German keyboard for ages. As Beastie has pointed out, I have setxkbmap set to de in my .xinitrc.


----------



## znaya (Mar 31, 2010)

if my memory doesn't fail me i think part of the solution to my accented-characters-in-console-problem was to change the terminal type in /etc/ttys to cons24l1 and then restart init with `# kill -HUP 1`


----------



## fronclynne (Mar 31, 2010)

*This will not turn out well.*



			
				Beastie said:
			
		

> You have to set up a compose key. Execute `% setxkbmap -option compose:rwin` and put it in ~/.xinitrc or similar, so that it's executed every time you start X. Your compose key is now linked to the right "Windows" key.
> Do this test: press the compose key, press *"*, press *a*. You should have *Ã¤*. Note that all keys must be pressed and released immediately.
> Now have fun with the slash, comma, tilde, grave accent, apostrophe, etc.



MÃ¸Ã¸se bÃ¿tÃ¨s cÃ¤n bÃ® vÃ©rrÃ¬ nÃ¥sti, yÃ´Ã¼ knÃ¶w.

Haha, sweet.  Thanks.


----------



## kikinovak (Apr 2, 2010)

Neither of the suggested solutions worked. setxkbmap {fr,de,ch} works OK, but only for the "basic" layout of the keys (azerty for fr, qwertz for de and ch), but still I have no accented characters.

But I suspect something here. Does FreeBSD expect me to specify the encoding somewhere? My Linux system defaults to UTF-8, and thinking of it, I don't even know how FreeBSD handles this? Is it equally UTF-8-aware? Or do I eventually have to specify some latin1 encoding in some configuration file, like ISO-8859-1 or ISO-8859-15? (Nine years of GNU/Linux, habits die hard...)


----------



## sixtydoses (Apr 2, 2010)

@kikinovak

Stumbled on this page and it works for me. Prolly will give you some idea.

http://lists.freebsd.org/pipermail/freebsd-questions/2010-March/213702.html


----------



## balab (Jan 22, 2011)

*no accent characters on fr keyboard*

Hello,
I have the same problem and still not solved... I am trying to configure the xorg session for my French keyboard. I am using FreeBSD 8.1 in a VM. I am using the basic /etc/X11/xorg.conf and after a lot of searching and reading I finaly got the French keymap (btw, I had to disable AutoAdd Devices).

I now have the correct keys but the accent letters (Ã© Ã¨ Ã  Ã¹ and also â‚¬ sign) keys still do not operate, I just get a bip instead. I have the same behavior on the text console.

I have also installed PC-BSD 8.1 and this one has an excellent French mapping. I tried to find where is the config, but I am too new to these OS.



Thanks


----------



## Beastie (Jan 22, 2011)

balab said:
			
		

> but the accent letters (Ã© Ã¨ Ã  Ã¹ and also â‚¬ sign)  keys still do not operate , I just get a bip instead.


`% setxkbmap fr`

```
2 = Ã©
7 = Ã¨
9 = Ã§
0 = Ã 
% (or " on a QWERTY keyboard) = Ã¹
```
Quite "incredible" eh?


----------



## balab (Jan 22, 2011)

Unfortunately this does not give me the accent letters. I tried the `setxkbmap fr` in a xterm windows and also tried to set the French kb directly in the xorg.conf. The only step I succeed is to obtain an "AZERTY" keyboard but no Ã© Ã¨ Ã  etc....

In the xorg.conf, I set the section as shown here


```
Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
	Option 	"XkbModel" "pc105"
	Option  "XkbVariant" "nodeadkeys"
	Option	"XkbLayout" "fr"
	Option "CustomKeycodes" "off"
        Option "XKbOptions" "terminate:ctrl_alt_bksp"
EndSection
```

I also set Option 
	
	



```
"AutoAddDevices"	"Off"
```
 in ServerFlags, because if you don't do it you will allways get the us kb.

May be, it a a clue to say even in text console mode, I have the same behavior ...

thanks


----------



## Bra1n0v3rfl0w (Jan 22, 2011)

In FreeBSD 8.1 (but i think it will work in 7.3 too), to use all characters (eg: Ã² Ã§ Ã  Ã¹ Ã¨ Ã© Ã¬ $ â‚¬ Â£) on my it (italian) keyboard, i set:

In /etc/rc.conf

```
font8x8="iso15-8x8"
font8x14="iso15-8x14"
font8x16="iso15-8x16"
keymap="it.iso"
```

In /etc/ttys and in all other used consoles

```
ttyv0 "/usr/libexec/getty Pc"   cons25l1    on   insecure
```

In /.cshrc   and  /usr/home/username/.cshrc

```
setenv  LANG en_US.ISO8859-15
setenv  LC_MONETARY it_IT.ISO8859-15
setenv  LC_TIME it_IT.ISO8859-15
setenv  LC_NUMERIC it_IT.ISO8859-15
setenv  MM_CHARSET iso-8859-15
```

The above settings works in console, at least in mine (i use tcsh, and i prefer en_US language but the others).

While to enable in X, set:

In  /usr/local/etc/hal/fdi/policy/x11-input.fdi 

```
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.keyboard">
<merge key="input.x11_options.XkbModel" type="string">pc105</merge>
<merge key="input.x11_options.XkbLayout" type="string">it</merge>
</match>
</device>
</deviceinfo>
```

And finally in /usr/X11R6/lib/X11/fonts/misc/fonts.alias

change every font entry from:

```
-..........-iso8859-1
```

to:

```
-..........-iso8859-15
```

I think that replacing _*it*_ with _*fr*_ (or other country symbol) in the above files should work.

Good Luck!!


----------



## balab (Jan 23, 2011)

I fixed it for Xorg! Following your instructions I finally understood that only the LANG variable was missing in my configuration.

Here are the simple steps to configure Xorg :

I - In /etc/X11/xorg.conf

1: disable the automatic add andenable devices , otherwise you'll get a us kb


```
Section "ServerFlags"
Option "AutoAddDevices"	"Off"
Option "AutoEnableDevices" "Off"
Option "AllowEmptyInput" "Off"
EndSection
```

2: set your keyboard and preferences


```
Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
	Option 	"XkbModel" "pc105"
	Option  "XkbVariant" "nodeadkeys"
	Option	"XkbLayout" "fr"
	Option "CustomKeycodes" "off"
        Option "XKbOptions" "terminate:ctrl_alt_bksp"
EndSection
```

II - set the LANG variable[/B] ( to obtain the Ã©,Ã¨,â‚¬ etc... in a xterm window (the localize chapter of the handbook is helpful)

I have setup that globally for the machine via /etc/login.conf inserting 2 line in the 
default section. I took a look at PC-BSD config which is helpfull.


```
default:\

        [B][I]Many lines removed.....[/I][/B]

	:charset=UTF-8:\
	:lang=en_US.UTF-8:\
	:umask=022:
```
and recompile the file with cap_mkdb

You will get MM_CHARSET and LANG variables correctly set.

I am still searching for the console...


----------



## Bra1n0v3rfl0w (Jan 23, 2011)

Nice!

For ISO-8859-15 it works with my settings in FreeBSD-8.1-Release.
I don't know if UTF-8 work in console, cause i don't use it, and don't need it. 

You can try to set UTF-8 in /.cshrc and /usr/home/username/.cshrc

If don't work, read the Handbook, the Faqbook, the Articles and search the forum.
I saw, times ago, some threads regarding UTF-8 in console ... maybe ....

Good Luck!!


----------



## balab (Jan 23, 2011)

For Xorg environment both charsets are ok either UTF-8 or ISO-8859-1 or -15. What's important is to have LANG declared with a compatible charset.


----------



## Bra1n0v3rfl0w (Jan 23, 2011)

Did you test the settings for UTF-8 in console?


----------



## balab (Jan 24, 2011)

When LANG is not set I can hear a bip and diacritic characters do not show (nor â‚¬ sign)
both in text console and in xTerm.

When LANG is set to en_US.UTF-8 or other compatible character set. The text console does not show diacritic characters but no more beep. When I enter Ã© for example , I have to hit enter 5 times to have \351 printed on the screen. The xTerm is really fine and I get all the characters from my french keyboard.


----------



## Bra1n0v3rfl0w (Jan 24, 2011)

If UTF-8 don't work in console, but iso-8859-15 do, why you don't use different settings, iso-8859-15 for console and UTF-8 for X?

I'm not sure it will work, but you can try.


----------

