Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
2  
Why not use \usepackage[utf8]{inputenc} to be able to use utf8 characters? –  N.N. Oct 12 '11 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 Oct 12 '11 at 11:43
add comment

migrated from stackoverflow.com Oct 12 '11 at 14:27

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 8 down vote accepted

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}
share|improve this answer
    
great references, thanks a lot! –  thias Oct 16 '11 at 7:35
    
I would appreciate to know which solution you have found. I also want a command which would transform ö into \"o... –  nicolas roy Feb 22 '12 at 22:41
    
Note that \bibliography is obsolete and replaced by \addbibresource{Bibfile.bib} (mandatory suffix) (cf. manual, sec. 3.5.1). –  Tobi Apr 18 '12 at 21:55
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.