GeneralHow to change UTF8 to Latin1

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
karimovy
Posts: 3
Joined: Sun Apr 10, 2016 8:50 pm

How to change UTF8 to Latin1

Post by karimovy »

I'm trying to write my CV in French, I 'll Need Putting some words with accents. how can I do?
When I add \usepackage[latin1]{inputenc} nothing happens.
Last edited by cgnieder on Mon Apr 11, 2016 7:05 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

How to change UTF8 to Latin1

Post by cgnieder »

With inputenc you only tell LaTeX which encoding your file has. The actual encoding can be set with the editor (emacs, vim, TeXstudio, …) that you're using. You need to ensure that the file actually has latin1 (ISO 8859-1) encoding. Only afterwards \usepackage[latin1]{inputenc} will ensure that the characters of your input and the output after compiling will match.

Regards
site moderator & package author
karimovy
Posts: 3
Joined: Sun Apr 10, 2016 8:50 pm

How to change UTF8 to Latin1

Post by karimovy »

Hi , thank you for your help.
I tried to change utf8 to iso8859-1 before and I got this message :

Code: Select all

! Package inputenc Error: Keyboard character used is undefined
(inputenc) in inputencoding `latin1'.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
Last edited by cgnieder on Thu Apr 14, 2016 5:38 pm, edited 1 time in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

How to change UTF8 to Latin1

Post by cgnieder »

The first thing to do is to save/convert your file in the encoding you want to use (that's preferably utf8 but latin1 will work fine, of course). This is completely independent from inputenc and something you can do with your editor.

After that check your file if special characters (ä, ß, ø, – etc) are displayed correctly. If yes, everything's fine, if no, change them back by retyping them.

Once that is done add the inputenc package with the matching encoding as option.

If the errors still appear post an Infominimal working example showing the problems.

Regards
site moderator & package author
karimovy
Posts: 3
Joined: Sun Apr 10, 2016 8:50 pm

How to change UTF8 to Latin1

Post by karimovy »

hi , I could solve the problem by adding:

Code: Select all

\usepackage{selinput}
  \SelectInputMappings{%
      agrave={à},
      eacute={é},
      Euro={€}
  }
Last edited by cgnieder on Tue Apr 19, 2016 4:59 pm, edited 1 time in total.
Post Reply