LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-07-2020, 08:53 AM   #1
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Rep: Reputation: 30
lp to CUPS-PDF Euro Sign


Hi
Env Debian 9.9
kernel 4.9.0-9-686-pae
cups-pdf 2.6.1-22
Prb print to cups-pdf with lp command does not show euro sign ..
Description
i edit input-file with vi, inserting Euro sign unicode character
20ac ...the euro sign displays correctly...
the i issue "lp input-file" and the resulting input-file.pdf does not show the euro sign ,it instead display small box ...
i read this document
https://lists.cups.org/pipermail/cup...er/045577.html
it seems lp support only utf8
my locale setting are
_________________________________
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE=it_IT@euro
LC_NUMERIC=it_IT@euro
LC_TIME=it_IT@euro
LC_COLLATE=it_IT@euro
LC_MONETARY=it_IT@euro
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=it_IT@euro
LC_NAME=it_IT@euro
LC_ADDRESS=it_IT@euro
LC_TELEPHONE=it_IT@euro
LC_MEASUREMENT=it_IT@euro
LC_IDENTIFICATION=it_IT@euro
_________________________________

it is possible to get Euro printed with lp or other print programs to cups-pdf ?
Any help will be appreciated
thanks in advance
Maurizio
 
Old 05-07-2020, 09:23 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Why are you mixing UTF-8 and non-UTF-8 locales? This is just weird. Settle for UTF-8. As an example, here are my locale settings:
Code:
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=
 
Old 05-07-2020, 10:10 AM   #3
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Original Poster
Rep: Reputation: 30
hi
Thanks for the answer
I installed Debian Linux with us english language
because
English is supported world wide so if i have errors or problem customizion, serching google for a message written in english grant me support worldwide
Otherwise searching for a message written in italian limit the possibility to find a solution ..
Also this site is written in english ..if i post here error messages in italian or configuration panels wirttten in italian ,then no one will help me
So at installation time i choose to install us english utf8 and add also locale
it_IT@euro ...
here the locale -a output
_______________________________
C
C.UTF-8
en_US.utf8
it_IT@euro
it_IT.iso885915@euro
POSIX
_______________________________

if i issue the date command it correctly displays in italian format
i see you use de_DE.UTF-8 ,i installed linux on this machine some years ago ,so i do not remeber if a it_IT.UTF-8 was available ...

the problem is limited to pdf creation by lp command directed to cups-pdf ...i have not othe printer installed ...

problam can be easy recreated editing a file with vi and ctrl-shift-u 20ac enter ..it correctly create euro sign ...
i see you are from germany ...if using de_DE.UTF-8 fix the poroblem then i will inform how to add this locale ...
 
Old 05-07-2020, 10:22 AM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Quote:
Originally Posted by bong.mau View Post
i do not remeber if a it_IT.UTF-8 was available ...
It should be
Code:
sudo dpkg-reconfigure locales
 
Old 05-07-2020, 10:42 AM   #5
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Original Poster
Rep: Reputation: 30
locale

Hi i install it_IT.utf8 with dpkg-reconfigure
i modify /etc/default/locale ..with it_IT.utf8
and i cannot see anymore euro sign with vi editor
also adding again it with ctrl-shfit-u 20ac does not display the character ...
instead it display a box
reboot does not change how behave
so i returned with my original /etc/default/locale
in this way i can see euro sign with vi editor
your can recreate problem with
echo '€' > euro
lp euro to the cups-pdf printer
 
Old 05-07-2020, 10:53 AM   #6
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Original Poster
Rep: Reputation: 30
Euro sign

To further debugging i create a pdf document with libre office and it works
so the problem seems related to lp command
 
Old 05-07-2020, 10:55 AM   #7
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Original Poster
Rep: Reputation: 30
is there another program to print to cups ?
 
Old 05-07-2020, 11:27 AM   #8
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,140

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
Quote:
Originally Posted by bong.mau View Post
it seems lp support only utf8
Which includes the Eurosign! You problem is evidently that vi is not giving the correct code — being blissfully ignorant of vi, I cant help with that. But if you use an English language locale, you can still have your Eurosign. Firstly, use a British locale, not an American one — that way you get A4 paper, the metric system, correctly-displayed dates, etc. For the keyboard, the British one has € on AltGr 4, while the US one uses AltGr 5.
 
Old 05-07-2020, 11:48 AM   #9
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Quote:
Originally Posted by bong.mau View Post
i modify /etc/default/locale ..with it_IT.utf8
The locale is named it_IT.UTF-8 though.

Quote:
Originally Posted by bong.mau View Post
ctrl-shift-u 20ac
It's Ctrl+V u20ac in Vim though.

Also, can you please check what fonts are used in the generated PDF?
Use either pdffonts from poppler-utils
or mutool info -F from mupdf-tools.

Last edited by shruggy; 05-07-2020 at 12:51 PM.
 
Old 05-07-2020, 12:46 PM   #10
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Original Poster
Rep: Reputation: 30
locale

Hi
first of all thank for the answers ...
i entered euro sign with "ctrl-shift-u 20ac enter"
vi shows euro sign correctly also other editors like leafpad shows euro sign correctly
i create a small file with "echo" command containing a sample character set
'01234567890 ABCDEFGKJHILMNOPQRSTUVWXYZ €$£'
i switch to hex edit and the euro sign is hex'a4'
i will run dpkg-reconfigure locale and add english utf-8
then i commit an error because i assume it_IT.utf8 from what locale -a shows
i will try with IT-utf8
this is the output of pdffonts
bong@debian:~/PDF$ pdffonts char.pdf
________________________________________________
name Type Encoding emb sub uni object ID
none Type 3 Custom yes no yes 18 0
_______________________________________________

Maurizio

Last edited by bong.mau; 05-07-2020 at 12:47 PM.
 
Old 05-07-2020, 02:00 PM   #11
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Original Poster
Rep: Reputation: 30
locale update

Hi
i changed locale to
___________________________________-
LANG=en_US.UTF-8
LANGUAGE="en_US:en"
LC_MONETARY="it_IT.utf-8"
LC_TIME="it_IT.utf-8"
LC_MEASUREMENT="it_IT.utf-8"
LC_NUMERIC="it_IT.utf-8"
LC_PAPER="it_IT.utf-8"
LC_ADDRESS="it_IT.utf-8"
LC_TELEPHONE="it_IT.utf-8"
LC_NAME="it_IT.utf-8"
LC_IDENTIFICATION="it_IT.utf-8"
LC_COLLATE="it_IT.utf-8"
LC_CTYPE="it_IT.utf-8"
___________________________________
if i edit "char" file i find
01234567890 ABCDEFGKJHILMNOPQRSTUVWXYZ ¤$£
previously i see
01234567890 ABCDEFGKJHILMNOPQRSTUVWXYZ €$£
the hex value of '€' or '¤' is always 'a4'
looking at ASCII to Hex table 'a4' is '¤'
IMHO it seems cups-pdf prints ascii character and not unicode conversion
next i will try to change form "US utf-8" to "en utf-8" and provide a feeedback

Maurizio
 
Old 05-07-2020, 02:58 PM   #12
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Original Poster
Rep: Reputation: 30
locale

hi
setting locale to
LANG=en_GB.UTF-8
LANGUAGE="en_GB:en"
and then opening char file with vi or other editors shows the little box instead of euro sign ...
i returned using my old /etc/default/locale settings
i had no problems...all works well ---the only problem is cups pdf creation
i call "lp" with a my pgm that create an output report with a lot of euro sign
this damned character conversions causes me a lot of problem also with windows .....
going in hex edit in the file it shows 'a4' and cups pdf prints the ASCII 'a4' symbol
the little box ...
something goes wrong during lp processing or pdf creation by cups-pdf
Maurizio
 
Old 05-07-2020, 03:30 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Although there are many variables that might be causing your problem as a frame of reference I am using
debian 10
cups-pdf version 3.0.1
Being in the US my locale is LANG=en_US.UTF-8

I can insert a Euro sign character in vi, gedit or nano text editors and I can print successfully using cups-pdf printer.

Are you are running a desktop? If so try a GUI editor and then select print to file instead of the cups-pdf printer. If it works then maybe something is wrong with cups-pdf otherwise it might be how your locale is configured.

Look at the first line in the /etc/cups/cups-pdf.conf file which should contain the version number.
 
Old 05-07-2020, 05:07 PM   #14
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Original Poster
Rep: Reputation: 30
further testing

Hi Michael
thanks for the answer
i'm using debian 9.9 lxde desktop
following your suggestion
i opened "char" file with leafpad (lxde default text editor)
it correctly display the content "€$£"
i choose print to file and it creates an output.pdf that correctly display the Euro sign and off course the other currency sign .
with the "char" file still opened with leafpad i choose to print to pdf and it
correctly creates a pdf file with euro sign
may be the problem in "lp" command ?
my cups-pdf version is 2.6.1
to further diagnose i opened "char" file with vim and execute
:hardcopy > char.ps
then
ps2pdf char.ps
it creates a char.pdf that contain the euro sign
then i issue
enscript -o char.ps char
then
ps2pdf char.ps
it creates a char.pdf that does not contain euro but instead a box like "lp char" do
now here in Italy is late...tomorrow i will return working on ...
have a nice day

Maurizio
 
Old 05-07-2020, 06:38 PM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Both lp and lpr are cups command line utilities with slightly different options.

Just for fun try lpr
lpr -P PDF char_file (replace PDF with the actual queue name of your cups-pdf printer)
 
  


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
Replace the Euro-sign (€) using sed- Bartonsen Programming 19 12-13-2018 02:14 AM
KMail doesn't apply a filter with euro sign ka3ak Linux - Software 2 03-21-2016 10:19 AM
No euro-sign in RHEL 5 hunnemad Linux - Newbie 2 05-10-2008 04:03 PM
sign on invisible in gaim - NOT invi after sign on saravkrish Linux - Software 7 09-12-2005 10:55 PM
Big prob ! Special characters (like euro sign) needed + samba koencalliauw Arch 0 08-27-2003 01:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:43 PM.

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