LaTeX forum ⇒ XeTeXUse Norwegian characters in LuaLaTeX

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
drgz
Posts: 44
Joined: Sat Apr 18, 2009 8:40 pm

Use Norwegian characters in LuaLaTeX

Postby drgz » Tue Aug 17, 2010 11:43 am

Hello,

not sure if this is the best sub-forum to place this (maybe a mod. can move it if it's more appropriate elsewhere) but I'll try.

I'm trying to compile a document which includes Norwegian characters with LuaLaTeX.

My preamble looks like the following

  1. \documentclass[11pt,a4paper,norsk]{article}
  2.  
  3. \usepackage{fontspec}
  4. \setmainfont{XITS}
  5. \usepackage{marvosym}
  6. \usepackage[pdftex]{graphicx}
  7. \usepackage[obeyall]{siunitx}
  8. \pagestyle{empty}


Somewhere in the text I have a word gjennomføre, which obviously includes the norwegian character ø.

However, when the compiler gets to this line I get the following error

  1. ! String contains an invalid utf-8 sequence.
  2. l.63 gjennomf
  3. �re 45\\


Is there any package I need to include, or anything special I need to do in order to be able to use these characters?

I know that the XITS font supports these characters (tested in MS Office 2007), so that's not the problem. However, since I'm new to LuaLaTeX / XeLaTeX I haven't been able to figure this out yet.

I'm running TeXLive2010 pretest on my Ubuntu 10.04 (32bit) distro, if that should matter.

Any help is appreciated!

Best regards,

D.
Last edited by drgz on Tue Aug 17, 2010 7:15 pm, edited 1 time in total.

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Postby josephwright » Tue Aug 17, 2010 5:45 pm

What character set is the file saved in? Can you post a minimal working example rather than just a snippet? Perhaps upload your source so we can see the encoding in use.
Joseph Wright

drgz
Posts: 44
Joined: Sat Apr 18, 2009 8:40 pm

Postby drgz » Tue Aug 17, 2010 7:14 pm

Well, after reading your reply I have to say that I feel like the biggest idiot alive. I had forgotten to make sure that the document was in UTF-8 encoding, so once I copied the same text into a document encoded properly it compiled as desired.

Now I just need to have a post-it on my desk reminding me on that whenever I write documents to be compiled with (Lua/Xe)LaTeX I must encode the document in UTF-8. ;)

As I see this problem as solved I'd like to thank you for the help. Mentioning the encoding got me on the right track.

Best regards,

D.

**

Just one question in the end; how come the document does not need to be encoded in UTF-8 when the text is in English? I mean, earlier today I compiled some other documents which are entirely in English without any problems, and they all are written with Notepad++ with ASCII encoding. Is this just something that's needed when the text is non-English?

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Tue Aug 24, 2010 8:53 pm

drgz wrote:[…] Just one question in the end; how come the document does not need to be encoded in UTF-8 when the text is in English? I mean, earlier today I compiled some other documents which are entirely in English without any problems, and they all are written with Notepad++ with ASCII encoding. Is this just something that's needed when the text is non-English?

The English alphabet doesn't contain any special characters like e. g. most of the European languages. So source files for documents in English are independent of the input encoding.


Best regards
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

drgz
Posts: 44
Joined: Sat Apr 18, 2009 8:40 pm

Postby drgz » Sat Aug 28, 2010 4:23 pm

localghost wrote:
drgz wrote:[…] Just one question in the end; how come the document does not need to be encoded in UTF-8 when the text is in English? I mean, earlier today I compiled some other documents which are entirely in English without any problems, and they all are written with Notepad++ with ASCII encoding. Is this just something that's needed when the text is non-English?

The English alphabet doesn't contain any special characters like e. g. most of the European languages. So source files for documents in English are independent of the input encoding.


Best regards
Thorsten


I should have guessed that; but thanks for clarifying.

Best regards,

D.


Return to “XeTeX”

Who is online

Users browsing this forum: No registered users and 1 guest