[OS X TeX] Problems with iconv

Luis Vitorio Cargnini lvcargnini at gmail.com
Mon Jun 15 11:48:01 EDT 2009


Le 09-06-15 à 11:26, André Bellaïche a écrit :

> Dear Herb, dear Peter,
>
> Thank you for your help.
>
> The source of the problem was a \lowercase command in some .sty file  
> called by another .sty file called by the main file. I came across  
> it when trying to make a reduced file to show to you.
>
> In the old times, \lowercase could not handle diacritics, and I had  
> helped it by using very raw TeX commands. Of course this  
> construction was not stable enough to work well with latin1 and utf-8.
>
> I have replaced \lowercase by \MakeLowercase, and everything runs.
>
> André
>
>
>
> Début du message réexpédié :
>
>> De : Herbert Schulz <herbs at wideopenwest.com>
>> Date : 15 juin 2009 00:23:03 HAEC
>> À : TeX on Mac OS X Mailing List <macosx-tex at email.esm.psu.edu>
>> Objet : Rép : [OS X TeX] Problems with iconv
>> Répondre à : TeX on Mac OS X Mailing List <macosx-tex at email.esm.psu.edu 
>> >
>>
>>
>> On Jun 14, 2009, at 4:29 PM, André Bellaïche wrote:
>>
>>>
>>> Le 14 juin 09 à 22:58, Herbert Schulz a écrit :
>>>
>>>>
>>>> On Jun 14, 2009, at 2:59 PM, André Bellaïche wrote:
>>>>
>>>>>
>>>>> Le 14 juin 09 à 19:34, Herbert Schulz a écrit :
>>>>>
>>>>>>
>>>>>> On Jun 14, 2009, at 12:14 PM, André Bellaïche wrote:
>>>>>>
>>>>>>> I use TeXShop with some mac-encoded file which was converted  
>>>>>>> from latin1. This file typeset very well with  
>>>>>>> \usepackage[applemac]{inputenc}
>>>>>>>
>>>>>>> I convert it back using
>>>>>>>
>>>>>>> iconv -f MAC -t LATIN1 nchapitres.tex > nchapitreslatin1.tex
>>>>>>>
>>>>>>> By typesetting  nchapitreslatin1.tex (with \usepackage[latin1] 
>>>>>>> {inputenc}), I get the error :
>>>>>>>
>>>>>>> 						! Package inputenc Error: Keyboard character used is  
>>>>>>> undefined
>>>>>>> 						(inputenc)                in inputencoding `latin1'.
>>>>>>> 						 ...
>>>>>>> 						 l.369 \end{example}
>>>>>>>
>>>>>>> This is rather surprising, since the output of iconv is  
>>>>>>> supposed to be made with latin1 characters.
>>>>>>>
>>>>>>> I try UTF8 instead of LATIN1
>>>>>>>
>>>>>>> iconv -f MAC -t UTF8 nchapitres.tex > nchapitresutf8.tex
>>>>>>>
>>>>>>> By typesetting  nchapitreslatin1.tex (with \usepackage[utf8] 
>>>>>>> {inputenc}, and utf8 in the preferences of TeXShop), I get the  
>>>>>>> error :
>>>>>>>
>>>>>>> 						Overfull \hbox (3.11702pt too wide) in paragraph at  
>>>>>>> lines 361--368
>>>>>>> 						[...] .endexample |
>>>>>>>
>>>>>>> 						! Package inputenc Error: Unicode char \u8:„©l not set  
>>>>>>> up for use with LaTeX.
>>>>>>>
>>>>>>> Puzzling!
>>>>>>>
>>>>>>> I tried to make the conversions uisng TextEdit, I got the same  
>>>>>>> results.
>>>>>>>
>>>>>>> André
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Howdy,
>>>>>>
>>>>>> How is it being read into TeXShop?
>>>>>>
>>>>>> Good Luck,
>>>>>>
>>>>>> Herb Schulz
>>>>>> (herbs at wideopenwest dot com)
>>>>>
>>>>> Like this:
>>>>>
>>>>> %!TEX TS-program = latex
>>>>>
>>>>> \documentclass[twoside]{book}
>>>>>
>>>>> \usepackage{textcomp}
>>>>> \usepackage[T1]{fontenc}
>>>>> \usepackage[french]{babel}
>>>>> \usepackage{amssymb}
>>>>> \usepackage{mathptmx}
>>>>> \usepackage[utf8]{inputenc}
>>>>>
>>>>> \begin{document}
>>>>>
>>>>> \input{nchapitresutf8.tex}
>>>>>
>>>>> \end{document}
>>>>>
>>>>> André
>>>>>
>>>>
>>>>
>>>> Howdy,
>>>>
>>>> So TeXShop is going to open the file assuming the encoding is  
>>>> whatever you set as the default in TeXShop->Preferences but all  
>>>> of the text seems to be in nchapitresutf8.tex sos that should be  
>>>> ok.
>>>>
>>>> Are you sure the document nchapitresutf8.tex is, in fact utf-8?  
>>>> Try opening it in TeXShop using the Cmd-O command and make sure  
>>>> the encoding is set to utf-8 BEFORE opening it. Also, make no  
>>>> changes to the document and certainly don't save it. Does  
>>>> everything look ok? Is the document really UTF-8?
>>>>
>>>> Good Luck,
>>>>
>>>> Herb Schulz
>>>> (herbs at wideopenwest dot com)
>>>>
>>>
>>> Well,
>>>
>>> The default in TeXShop->Preferences is set to UTF-8.
>>>
>>> The document nchapitresutf8.tex is utf-8. When I try to open other  
>>> documents, either in applemac or in latin1, a window opens, saying  
>>> that the text could not be open with utf-8 encoding.
>>>
>>> Another way to check the encoding of the file is to use TextEdit,  
>>> by setting the opening preferences nto applemac, latin1 and utf-8.  
>>> TexShop is willing to open nchapitresutf8.tex whatever be the  
>>> encoding, but it is only with the preference set to utf-8 that we  
>>> get a text without fault.
>>>
>>> The main file has also been converted to utf-8, (by TextEdit).
>>>
>>> But I still get the error message
>>>
>>> ! Package inputenc Error: Unicode char \u8:„©l not set up for use  
>>> with LaTeX.
>>>
>>> (I am not sure that the console uses utf-8. It seems that the  
>>> error message is set in latin1, and then displayed (without  
>>> conversion) utf-8.)
>>>
>>> Thank for your help.
>>>
>>> A.B.
>>
>>
>> Howdy,
>>
>> Do you know what character it's choking on? It really may be true  
>> that the times font used with mathptmx is missing a character. Try  
>> using
>>
>> \usepackage{lmodern}
>>
>> instead of mathptmx and see what happens. Have you ever tried to  
>> use xelatex?
>>
>> Good Luck,
>>
>> Herb Schulz
>> (herbs at wideopenwest dot com)
>>
>>
>>
>

try this:

\usepackage[applemac]{inputenc}

generally it is working for me, it let the system decide the best  
suitable encoding based on system configuration, or even if you are  
mixing utf-8 with apple roman encoding.






-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1842 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/macosx-tex/attachments/20090615/964bcb44/attachment.p7s>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://email.esm.psu.edu/pipermail/macosx-tex/attachments/20090615/964bcb44/attachment.sig>


More information about the MacOSX-TeX mailing list