# Compatibility issues with WinEDT. How do I fix it?

I've been having compatibility issues when using MikTeX with WinEDT on a Windows 7 laptop. More particularly, when I go to open certain .tex documents that someone else has been working on with a different computer and editor, strange characters appear in the file where they shouldn't, e.g. the Â character occurring in the middle of "maximum" like this "maxiÂ-mum". And when I try to build the .tex document, it fails and gives errors such as:

! Package inputenc Error: Keyboard character used is undefined
(inputenc)                in inputencoding latin1'.


Looking on this site, I found this question which seems to be about the same problem I'm having Kile document doesn't work well in WinEdt. How do I convert it? However, I tried some of the suggestions mentioned there but I couldn't get them to work. First I tried downloading TeXStudio, which was mentioned in one of the comments as being able to work with UTF-8 encoding, but I still get problems with this. Specifically, the strange characters no longer appear in the .tex file when I open it in TeXStudio, but if I build a pdf, the strange characters now appear in the .pdf file. I also tried opening the .tex files in WinEDT using the UTF-8 option, and although the strange characters don't appear in the .tex document when I do this, it still won't build and returns the same errors that I get when I don't open it using the UTF-8 option.

If anyone knows a TeX editor that is more compatible than WinEDT or has an idea of how I can fix the issues I've been having WinEDT or TeXStudio, it would be much appreciated!

-
Do you know what encoding this 'other person' might be using? Can you post a small example somewhere that we can check? It's possible you are being sent files that are saved in an encoding that WinEdt is not auto-detecting, but without a file it's hard to say. – Joseph Wright Aug 14 '12 at 19:46
Thanks for your quick reply! Unfortunately this is a project which a number of different people have been working on over a number of years and I've only started on it recently, so I'm not sure who has been working on these files before me to ask about the encoding. What sort of example should I post? Thanks for your help! – Becky Aug 14 '12 at 19:57
A link to somewhere we can download a file showing the 'odd' characters is what is needed. We can then take a look and see what the encoding actually is, and might then be able to give more advice. – Joseph Wright Aug 14 '12 at 20:01
The option is called utf8. But stop to change your files you can confuse the encoding completly. I hope you still have the original files. Compile them at first without changing anything, then check the pdf and look how non-ascii chars where printed. If they did come out right then you will know from the inputenc option the encoding of the file and can start to figure out how to tell it winedt. Btw: Absolutly no encoding problem will insert funny chars in the middle of maximum. It must already have been there (e.g. as accent or non breakable space). – Ulrike Fischer Aug 15 '12 at 7:39
Continuing: And because of the funny chars in maximum I think that the original files are incorrect and that you will already get errors with the original files. Beside this you should mention which winedt version you are using. There have been major changes between winedt 6 and 7. – Ulrike Fischer Aug 15 '12 at 7:46

Because it it too long for an comment this answer. I'll try to show you the reason for your errors.

Try to compile the follwing MWE:

\documentclass{article}

\usepackage{lmodern}            % Latin Modern
\usepackage[T1]{fontenc}        % Font encription
%\usepackage[utf8]{inputenc}    % input encription utf-8
\usepackage[latin1]{inputenc}  % input encription Latin1

\begin{document}
Test to test encoding (this is written in utf-8): äöüß ÄÖÜ

\end{document}


You should get errors. Now delete the % sign (line utf-8) and comment the following line (latin1). Compile. Now you should have no errors.

The reason is that file and encoding information are not the same. They have to be the same.

With WinEdt you can store a file as utf-8 with file-- Save as and set file-type to :UTF-8.

If this MWE runs for you try to copy some lines from your tex file into the MWE and try to compile it. Try to save it as utf-8. Hope this helps you.

Update: I just installed WinEDT and found TeX in the bottom line. Click on TeX and you will get a window like this:

Now click on CP Converter and you can see the encription code WinEDT found and you can change it.

-
Thanks for your response Kurt. I tried following your instructions for the MWE in WinEDT 7 and it worked, but when I tried it for the files that have given me trouble, it produced a number of new errors and more errors than before. I will keep working on it and see if I can figure it out. Thanks again for your help. – Becky Aug 14 '12 at 22:44
@Becky: encriptions are a difficult thing and without more information from you (parts of the used preambel and lines which result in an error) we can't help more. Btw your error with maximum looks like a problem with a hidden hyphenation mark. – Kurt Aug 14 '12 at 22:51
@Kurt: All you advices are very sound when it comes to create new files and get the inputenc` option right. But Becky has existing files and so at first needs a way to identify the encoding of the files. – Ulrike Fischer Aug 15 '12 at 7:44

When I used this program, I came across a similar problem. I believe that WinEdt uses strictly ANSI. If the file is saved in another encoding (UTF8), I got this similar error. Helped me when I opened the file in another editor such as Notepad ++ and switched encoding to ANSI. For some characters, I had to done a manual correction.

-
The current version of WinEdt (7.0, around since February or March) is fully unicode-compliant. – Mico Aug 14 '12 at 21:34
Even older versions on winedt could handle (a restricted) utf8. – Ulrike Fischer Aug 15 '12 at 7:41