Fixed endnote/footnote rtf encoding (Merged from master)
Added fixes from user vansante manually
(cherry picked from commit 5e651c7)