This looks like a bug to me.
Create a new empty article and use the Insert Symbol tool to put in
some miscellaneous smiley faces and what not. This is the source view
of the file, which does compile.:
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{wasysym}
\usepackage{babel}
\begin{document}
\frownie \smiley \blacksmiley \sun{}
\end{document}
Then I went into Settings -> Language and changed input to utf-8.
That had the effect of automatically replacing \frownie and \smiley
with unicode symbols in the LaTeX source, like so:
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{wasysym}
\usepackage{babel}
\begin{document}
☹☺☻☼
\end{document}
That does not compile, rather the error messages say:
Package inputenc Error: Unicode char ☹ (U+2639)
Package inputenc Error: Unicode char ☺ (U+263A)
Package inputenc Error: Unicode char ☻ (U+263B)
Package inputenc Error: Unicode char ☼ (U+263C)
My thought was that LyX should not replace \frownie with ☹ unless the
document would otherwise compile correctly.
I had not too much understanding of Unicode when I started to look
into this. I found several ways to deal with this. The easiest is to
simply put "\frownie" and "\smiliey" back in the document. So far as I
can see, there's no real benefit to me that those things are entered
as ☹ symbol. I can understand, however, that when authors need to
enter letters with accents, then they have a more pressing need to
make this work.
I wrote out ways this can be corrected, with preamble adjustments
using either DeclareUnicodeCharacter or newunicodechar, on
Stackexchange
(https://tex.stackexchange.com/questions/452494/lost-my-smilies-it-is-worth-the-effort-to-make-unicode-work),
we'll see what they say about it. I'm predicting the answer will be
"learn the ins and outs of xelatex".
But I do think it is a LyX bug that Unicode symbols are introduced but
can't be compiled.
I'm interested to hear your ideas.
pj
--
Paul E. Johnson http://pj.freefaculty.org
Director, Center for Research Methods and Data Analysis http://crmda.ku.edu
To write to me directly, please address me at pauljohn at ku.edu.