Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

International symbols, UTF8

379 views
Skip to first unread message

Andrey None

unread,
Feb 9, 2011, 7:24:44 AM2/9/11
to
Hi!

I decided to test gnuplot 4.4.2 on my Debian Linux ("Lenny"). The main
thing I'm interested in was an UTF-8 support and I tried to pass a
simple test.

I downloaded latest gnuplot-4.4 code and built it. Then I wrote a
simple script which prints simple chart with a title in three
languages: english, russian and greek:

# script start ==============================
set encoding utf8
set title "Hello, world! Привет, мир! Γεια σας κόσμο!"

set terminal pdf enhanced
set output "test.pdf"
plot sin(x)

set terminal postscript eps enhanced
set output "test.eps"
plot sin(x)

set terminal png
set output "test.png"
plot sin(x)
# script end ==============================

Script is written in UTF-8 encoding. Terminal I'm running gnuplot
from, has UTF-8 encoding too. LC_CTYPE environment variable is
ru_RU.UTF-8.

Results are following:
- PNG image is fine, the title is rendered perfectly.
- EPS file is wrong. Title indicates spaces in place of non-ASCII
characters.
- PDF file is wrong. Title indicates bad symbols (like Ð or ¼) in
place of non-ASCII characters.

I tried to find something usefull in Google and I couldn't. I saw
several reports in russian Ubuntu forums that gnuplot 4.4 works fine
with russian and UTF-8 without any special configuring.

Could you help me? Where should I dig in?

Thanks,
Andrey

A. Drosos

unread,
Feb 9, 2011, 11:30:10 AM2/9/11
to
On 2011-02-09, Andrey None <andrey...@gmail.com> wrote:
> Hi!
>
> I decided to test gnuplot 4.4.2 on my Debian Linux ("Lenny"). The main
> thing I'm interested in was an UTF-8 support and I tried to pass a
> simple test.
>
...<snip>

> Results are following:
> - PNG image is fine, the title is rendered perfectly.
> - EPS file is wrong. Title indicates spaces in place of non-ASCII
> characters.
> - PDF file is wrong. Title indicates bad symbols (like Ð or ¼) in
> place of non-ASCII characters.
...<snip>
I too use gnuplot on my Linux from Scratch system with el.UTF-8. Png is fine.
For eps and pdf I found that I can generate svg images that can easily be
converted to eps and pdf (via inkscape) with excellent results.

sfeam

unread,
Feb 9, 2011, 12:11:22 PM2/9/11
to
Andrey None wrote:

> Hi!
>
> I decided to test gnuplot 4.4.2 on my Debian Linux ("Lenny"). The main
> thing I'm interested in was an UTF-8 support and I tried to pass a
> simple test.
>
> I downloaded latest gnuplot-4.4 code and built it. Then I wrote a
> simple script which prints simple chart with a title in three
> languages: english, russian and greek:

Things to watch out for:

> Results are following:
> - PNG image is fine, the title is rendered perfectly.

Good. I assume you are using the libgd-based PNG driver.
All the libgd terminals default to using UTF-8

> - EPS file is wrong. Title indicates spaces in place of non-ASCII
> characters.

PostScript itself is grossly inadequate in supporting large character
sets. This applies to UTF-8. The README files in the distribution
directory .../term/PostScript explain how you can work around this to
access limited ranges of unicode characters, but frankly I think it is
not worth the effort. Use PDF instead.

> - PDF file is wrong. Title indicates bad symbols (like Ð or ¼) in
> place of non-ASCII characters.

The cairopdf terminal handles UTF-8 just fine. Is that what you are
using, or are you instead linking to the proprietary PDFLib library?
In the latter case I think you have to by a "professional license" to get
UTF-8 support. In other words, gnuplot is fine with UTF-8 but it is
limited by the external library. But as I said, the newer pdfcairo
terminal works fine and requires no proprietary support library.

Additional caveat:

When you build gnuplot you have a choice of three input layers:
gnu readline, bsd editline, or gnuplot's own code. The bsd input
layer does not handle UTF-8 correctly.

Michael

unread,
Feb 10, 2011, 10:44:05 AM2/10/11
to
Для eps я использую // For eps I use:

set terminal postscript eps enhanced color dashed adobeglyphnames


Andrey None

unread,
Feb 11, 2011, 2:52:27 PM2/11/11
to
On 9 фев, 20:11, sfeam <sf...@users.sourceforge.net> wrote:
> The cairopdf terminal handles UTF-8 just fine.  Is that what you are
> using, or are you instead linking to the proprietary PDFLib library?
> In the latter case I think you have to by a "professional license" to get
> UTF-8 support.  In other words, gnuplot is fine with UTF-8 but it is
> limited by the external library.   But as I said, the newer pdfcairo
> terminal works fine and requires no proprietary support library.

I have libcairo2 1.6.4-7 installed on my Debian Linux. PDFLib is
installed too, I used it to build prev. versions of gnuplot. How
should I configure installation and building of gnuplot in order to
use cairo and eliminate PDFLib?

Thanks a lot for reply.

Regards,
Andrey

sfeam

unread,
Feb 11, 2011, 3:09:10 PM2/11/11
to
Andrey None wrote:

I do not know the specific Debian packages required, but in order to
build gnuplot with the cairo terminals you need

libcairo
libpangocairo
libpango
libpangoft2


It is possible that those libraries in turn require additional
support packages that you will have to install first.

When you configure gnuplot using ./configure
it prints out a listing of which terminals it found support libraries
for. You should see a line like:

cairo-based pdf and png terminals: yes

If it says "no" rather than "yes", you can look in the output file
config.log to see exactly which libraries or headers were not found.

Ethan

0 new messages