LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-17-2017, 07:17 AM   #1
traacs support
LQ Newbie
 
Registered: Nov 2017
Posts: 2

Rep: Reputation: Disabled
Post lpr-command-shows-special-characters-in-linux


For the printer model EPSON LQ-300+II, When printing فاتورة through LPR command shows ΓÇÄ∩╗ô∩║Ä∩║ù∩╗«∩║¡∩║ô in Ubuntu 12.04 Linux.

However, when printing through gedit, the print of فاتورة shows as فاتورة

Kindly provide solution using ESC/POS command with example.
 
Old 11-19-2017, 03:19 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
why does it have to be with lpr?
maybe you should try with CUPS, the linux printing daemon.
also, which linux distro & what setup (server, desktop environment etc.)?
 
Old 11-19-2017, 10:15 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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
 
1 members found this post helpful.
Old 11-19-2017, 11:57 PM   #4
traacs support
LQ Newbie
 
Registered: Nov 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you for your reply.

What would be the command corresponding to " printf '\x1b(t130' >/dev/lpt1; cat myfile.txt >/dev/lpt1 "
 
Old 11-20-2017, 04:35 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
That is the command.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how do i remove ALL special characters in file names with one line command atjurhs Linux - Newbie 14 02-23-2017 07:38 AM
How to replace the symbol special characters using find command? lahirushanaka Linux - General 8 03-20-2013 11:23 AM
How to define a command in nagios with special characters abhinav4 Linux - Newbie 2 12-28-2012 03:54 PM
bash command for removing special characters from string kkpal Linux - Newbie 5 05-26-2008 08:14 AM
How to use special characters on linux???? Radicalm16 Linux - General 8 08-11-2007 12:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration