tags:

views:

26

answers:

1

I use php jpgraph library, but there i a small problem with charsets. lets assume graph.php generates the image, and i call it from some.php

some.php

     ...
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
     ...
    <img src="graph.php" />
     ...

as you see, i set charsets in some.php, but it doesn't show the text of the graph, which is in foreign language.(maybe i must set it in graph.php? but how?)

What is the problem?

Thanks UPDATE

even when i try to enter numerical HTML encoding of the Unicode character from here, it doesn't work for Armenia language:/

+1  A: 

The meta tag only applies to the content of the page, not to images displayed within the page (even images generated dynamically by your graph.php script)

Quoting from the jpgraph faq

16 How can I print unicode characters?

Use &#XXXX; format in your strings where XXXX is the decimal value for the unicode character. You may find a list of Unicode characters and there encodings at www.unicode.org Please observe that the encoding in the lists are given in hexadecimal and these values must be converted to decimal.

Note: If You are working in an UTF-8 environment then the characters may be input directly.

Mark Baker
what does it mean? `If You are working in an UTF-8 environment then the characters may be input ` **directly** ??
Syom
It means if your script file (graph.php) is UTF-8, then you can do $graph->title->Set('チュートリアル');
Mark Baker
but how can `graph.php` be utf-8? it's php file, with no encoding type. and when i try to enter characters in `dec` format, doesn't work:/ look at update pls
Syom
Most good file editors and IDEs now allow you to save a script file as UTF-8 (don't try to save it with a BOM header though)... even Windows Notepad has this option now.
Mark Baker
i've tried to save it as utf-8 too, still doesn't work.for example, when i wrote `$graph->title->Set("Բ");`, which is the simbol for Ա in armenian, it show unknown simbol.
Syom