I translated the document from English into Norwegian in LaTeX format, and when using special characters from Norway I get an error message using
\usepackage[utf8x]{inputenc}
to try to display Norwegian (Scandinavian) special characters in PostScript / PDF / DVI format, saying
Package utf8x Error: MalformedUTF-8sequence.
So, until this worked, I tried another possible solution:
\usepackage{ucs} \usepackage[norsk]babel
And when I tried to save this 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 opportunity to check the properties of these 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 it with texi2dvi -dvipdf filename.text, I get a perfectly fine PDF file, without any special Norwegian-style characters.
When I am going to save Emacs, also ask me: “Select the encoding system (default source):” And I type utf-8 to select my encoding system. I also tried to select the default source to see if I got a different result. But nothing.
Finally I tried \ lstset {inputencoding = utf8x, extendedchars = \ true} ... the code that I came across while Google was trying to solve this problem. Which gives me this error: Undefined.
Basically, I tried every encoding parameter that I managed to find, and nothing works. I am desperate to make this work, as the Norwegian translation must be published before the deadline.
As additional information, I can add that I later found out that I only had en_US.UTF-8 in my locale, so I added nb_NO.UTF-8 and nb_NO.ISO-8859-15 and ran localegen + reboot without any changes.
Hope I have provided enough information to get help, the characters in question are æ ø å.