# LyX Error: Could not find LaTeX command for character '' (code point 0x2009)

I have been trying to copy and paste some code into LyX (via the 'Program Listings' menu item), and when I compile the document I get the LyX error:

``````Could not find LaTeX command for character '' (code point 0x2009)
``````

LyX also suggested I convert the document I am attempting to copy and paste to UTF-8. However, I ran a `file --mime <mycodefile.py>` and a `file --mime <mycodefile.py>` and both return `charset=us-ascii`.

Correct if I'm wrong, but isn't ascii a subset of UTF-8? If so, where is this offending 0x2009 character coming from, and how to I fix this issue?

Thanks

Note: instead of copying and pasting, I tried using 'Insert> File > Plain Text ...', and I got the same error. So it's not like the text is being reencoded somehow in the clipboard.

EDIT:

for some reason, after restarting lyx i could compile (slaps forehead). when I copy/pasted originally, the encoding may have been unicode, but then I cntl-Z'd and switched it to UTF-8 using vim. This error somehow persisted until restart.

-
Restarting does seem to help, even if you just deleted the offending spaces. –  freespace Aug 21 '13 at 11:06

can't LaTeX handle any UTF-8 character? I thought 0x2009 was unicode. in any case, thanks for your answer. I tried a `cat <filename> | sed -e s/\x2009/ /g` –  nbren12 Apr 11 '12 at 21:37
@nbren12 LaTeX can handle some unicode characters, but two conditions must be met: i) The document source code must be UTF-8, and ii) the unicode character in question must be mapped to a symbol in a font. The `inputenc` package handles this, but not all unicode characters are mapped. –  spet Apr 11 '12 at 21:48