Welcome to LinuxQuestions
Its been awhile since I've played with a dot matrix printer and with my limited understanding I think the problem is...
lpr is a cups CLI command. I don't remember what cups version was installed in Ubuntu 12.04 and if it could be due to changing the text filter from Postscript to PDF.
gedit uses UTF code that based upon the LANG environment variable and it ouputs PS or PDF when you select print that gets converted/rendered to ESC/PS code. lpr/cups "sends" the raw text file without consideration to the LANG variable to the backend filter which then gets printed.
Although UTF is supposed to be backwards compatible with ASCII I don't know if changing printer character sets would solve the problem. There are a couple of utilities that could work which might be easier to implement like iconv or paps but not sure if they are installed by default and 12.04 has reached EOL so easily installing from the repositories is not possible until the OP upgrades.
I'm guessing and have no way to test the code.
printf '\x1b(t130' >/dev/lpt1; cat myfile.txt >/dev/lpt1
https://files.support.epson.com/pdf/...l/escp2ref.pdf