5

The title says it all. I have a unicode (utf-8) file which contains some non-ascii characters, e.g. "ö" and translate it into an ascii-file where the non-ascii characters are replaced with tex-macros, in this case \"o.

Any ideas? I found this converter but it's only to HTML.

3
  • 2
    Why not use \usepackage[utf8]{inputenc} to be able to use utf8 characters?
    – N.N.
    Commented Oct 12, 2011 at 10:11
  • I don't want it for latex but for handling my bibtex-database. Many tools do not treat utf-8 correctly
    – thias
    Commented Oct 12, 2011 at 11:43
  • related: tex.stackexchange.com/questions/186733/…
    – matth
    Commented Jul 10, 2015 at 11:06

2 Answers 2

8

you can take a look at utf2any
http://www.ctan.org/pkg/utf2any
not sure if it does what you want

or maybe some other package from one of these lists
http://www.ctan.org/keyword/encodings
http://www.ctan.org/characterization/primary/tools/convert-formats/

generally i would say it is preferrable to use a completly utf8 capable toolchain instead of converting utf8 files to non-utf8

edit: i see you want for utf-8 for you bibliography: there are utf-8 capable tools available for this. instead of bibtex you can use biblatex and biber - switching is easy! i have lots of äöüß and more in my .bib-file and it works just great. as a start you can try something like

\usepackage[
    backend=biber,
    style=authoryear-icomp,
    sortlocale=de_DE,
    natbib=true,
]{biblatex}
\bibliography{Bibfile}
2
  • I would appreciate to know which solution you have found. I also want a command which would transform ö into \"o... Commented Feb 22, 2012 at 22:41
  • Note that \bibliography is obsolete and replaced by \addbibresource{Bibfile.bib} (mandatory suffix) (cf. manual, sec. 3.5.1).
    – Tobi
    Commented Apr 18, 2012 at 21:55
3

With biblatex and biber, you can set the biblatex options

bibencoding=utf8
texencoding=ascii

And biber will reencode your utf8 bib file into TeX macros in the .bbl

See the biber manual for details and options

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .