No norwegian characters in LaTeX

Posted by DreamCodeR on Stack Overflow See other posts from Stack Overflow or by DreamCodeR
Published on 2010-04-06T21:08:52Z Indexed on 2010/04/06 21:13 UTC
Read the original article Hit count: 384

Filed under:
|
|
|
|

Hi,

I have translated a document from English to Norwegian in the LaTeX format, and while using norwegian special characters, I get an error using

\usepackage[utf8x]{inputenc}

to try and display the norwegian (scandinavian) special characters in PostScript/PDF/DVI format, saying

 Package utf8x Error: MalformedUTF-8sequence.

So while that didn't work, I tried out another possible solution:

\usepackage{ucs}
\usepackage[norsk]babel

And when I tried to save that in Emacs I get this message:

These default coding systems were tried to encode text
in the buffer `lol.tex':
(utf-8-unix (905 . 4194277) (916 . 4194245) (945 . 4194278) (950
. 4194277) (954 . 4194296) (990 . 4194277) (1010 . 4194277) (1013
. 4194278) (1051 . 4194277) (1078 . 4194296) (1105 . 4194296))
However, each of them encountered characters it couldn't encode:
utf-8-unix cannot encode these: \345 \305 \346 \345 \370 \345 \345 \346 \345 \370 ...

Thanks to Emacs I have the possibility to check out the properties of those characters and the first one tells me:

character: \345 (4194277, #o17777745, #x3fffe5)
preferred charset: eight-bit (Raw bytes 128-255)
code point: 0xE5
syntax: w    which means: word
buffer code: #xE5
file code: not encodable by coding system utf-8-unix
display: not encodable for terminal

Which doesn't tell me much. When I try to build this with texi2dvi --dvipdf filename.text I get a perfectly fine PDF, all without the special norwegian characters.

When I am about to save Emacs also ask me: "Select coding system (default raw-text):" And I type in utf-8 to choose its coding system. I have also tried to choose default raw-text to see if I get some different result. But nothing.

At last I tried \lstset{inputencoding=utf8x, extendedchars=\true} ... a code I came over while trying to google the solution to this problem. Which gives me this error: Undefined control sequence.

So basically, I have tried every encoding option I have been able to find and nothing works. I am desperately trying to make this work since the norwegian translation must be published before the deadline.

As an additional information I may add that I found out later on that I only had the en_US.UTF-8 in my locale, so I added nb_NO.UTF-8 and nb_NO.ISO-8859-15 and ran locale-gen + reboot without any changes.

I hope I provided enough information to get some assistance, the characters in question is æ ø å.

© Stack Overflow or respective owner

Related posts about latex

Related posts about i18n