I use PHP GD Imagecraft to dynamically add text to animated gifs. And I allow users to input their own text strings to add text to animated gifs.
However, when I attempt to sumbit words in Spanish, a gif is not generated; when I attempt to submit words in Russian, the input is not accepted.
You can see an example here: https://clicktopick.org/vote/results/star_wars_ESP.php?cat=star_wars_ESP&email=YWpAYWxhbmphY29ic29uLm9yZw==&f_name=Alan&gender=male
Note the that placeholder text includes the word "línea" with an accent over the "í". So I know my page can render UTF-8 characters. However, if I attempt to submit the word "línea," to PHP GD Imagecraft, a gif is not generated.
I am storing terms in Spanish and Russian for display elswhere on my site, so I do not suspect encoding on the DB.
My page includes:
English: # % (generate error)
Spanish: línea (generates error)
Portuguese: pontuações (generates error)
Russian: ДРАКОНИЙ (input not recognized)
If you are retrieving and submitting data to/from a database, you should add this line directly after establishing the database connection in PHP:
$connect1->set_charset("utf8");
(where connect1
stands for your db connection)
I found the problem. It was a 64-bit encoding issue. Data in Russian would not pass to $_REQUEST with 64-bit encoding.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.