# Arabic characters in text

I saw there are numerous questions and answers for typesetting Arabic characters. Yet I can't get them work. I tried to replicate this answer, which is exactly what I want to obtain - few in line Arabic characters. I haven't changed the MWE of the mentioned answer:

\documentclass[a4paper,10pt]{article}
%In the preamble section include the arabtex and utf8 packages
\usepackage{arabtex}
\usepackage{utf8}

\begin{document}
%start encoding to unicode
%Note that your layout must support arabic text when compiling
\setcode{utf8}
%To start typing in Arabic use the command arabtext
hello
\<السَلامُ عَليكم ورَحمةُ الله وبَركاته  >
arabic
\end{document}

Yet LaTeX, without throwing any error, typeset this:

I tried to open the PDF with Skim, Adobe Pro and Mac Preview with the same result.

I am using TeX 3.14159265 (TeX Live 2014) kpathsea version 6.2.0 of the MacTeX-2014 Distribution and Aquamacs as text editor.

My best guess is that I have some encoding problem somewhere in the pipeline. My .tex file is encoded in utf-16 and in the text editor rightly shows the characters:

• Without a MWE it's guesswork. – egreg Jun 29 '14 at 22:52
• I get the same output as Heiko's from that code. The TeX distribution is the same as yours. See i.stack.imgur.com/rdwU8.png – egreg Jun 29 '14 at 23:04

You have improper encoding: UTF-16 instead of expected UTF-8. It may be still visible in your graphic editor, but makes a false input to the pdflatex (e.g.) program.

• To change current file encoding on Emacs: C-x C-m f utf8 – Francesco Jun 29 '14 at 23:23
• @Francesco Or just type % -*- coding: utf8 -*- as the first line of the file, which will also ensure the file will be treated as UTF8 no matter what. – egreg Jun 30 '14 at 9:09