Jump to content
TNG Community

Google Maps 15: UTF-8 characters rendered as squares in pin legend


Janusz

Recommended Posts

Janusz

I'm using Google Maps 15 on TNG 15.0.5 (the same issue was present on TNG 14).

The pin legend generated by google_text_marker.php does not display Polish characters correctly.

Examples:

  • PANSTWO = displayed correctly

  • PAŃSTWO = displays empty squares instead of the Polish character

I tested the following:

  • language files are UTF-8

  • URL parameter is passed correctly (e.g. miejscowo%C5%9B%C4%87)

  • hardcoded text in google_text_marker.php:
    $string = 'PAŃSTWO';

  • LiberationSans-Regular.ttf

  • DejaVuSans.ttf

  • original and rewritten versions of google_text_marker.php

ASCII text always works, but Polish characters (ą ć ę ł ń ó ś ź ż) are rendered as empty squares.

GD reports:

  • FreeType Support = enabled

  • FreeType Linkage = with freetype

Has anyone successfully used Google Maps 15 with Polish (or other Central European UTF-8 characters) in the generated pin legend?

Link to comment
Share on other sites

ajnsmits

I only have one person in Poland, but I use OpenStreetMap. I switched my map settings to Google Maps for a moment, and it seems to be working for me—see the screenshot. Or is that not what you meant?  o, I see now that it's a mod. I'll see if I can install it.

 

Schermafbeelding 2026-06-02 183205.jpg

Link to comment
Share on other sites

ajnsmits

You might want to check your database settings.

Schermafbeelding 2026-06-02 185205.jpg

Link to comment
Share on other sites

Janusz

Thank you for checking.

I don't think this is a database collation issue.

The attached screenshot shows the problem. The labels are generated by google_text_marker.php and all non-ASCII Polish characters are rendered as empty squares.

I also tested by hardcoding text directly in google_text_marker.php, for example:

$string = 'MIEJSCOWOŚĆ';

The result is still empty squares, while:

$string = 'MIEJSCOWOSC';

renders correctly.

I tested both LiberationSans-Regular.ttf and DejaVuSans.ttf with the same result.

Could someone else test a hardcoded string containing non-ASCII characters (ÄÖÜ, ÅÄÖ, éèê, etc.) in google_text_marker.php and see if it renders correctly?

Zrzut ekranu 2026-06-02 200724.png

Link to comment
Share on other sites

ajnsmits

I just changed a word in my Dutch language file from a Polish word with special characters, and now the last pin is in Polish. I don't know where to find the others.

Schermafbeelding 2026-06-02 204022.jpg

Schermafbeelding 2026-06-02 204424.jpg

Link to comment
Share on other sites

Janusz

Interesting, thank you!

That changes things completely.

Your screenshot clearly shows Polish characters (Ż, Ś, Ć) rendered correctly by the same google_text_marker.php mechanism.

So the issue is apparently not a general bug in Google Maps 15.

Could you please tell me:

  • Which PHP version are you using?

  • Which TNG version?

  • Which server OS (Linux/Windows)?

  • Which MySQL/MariaDB character set and collation?

I tested with both LiberationSans-Regular.ttf and DejaVuSans.ttf and still get empty squares for Polish characters.

Link to comment
Share on other sites

Janusz

I believe this worked correctly on my site in older years. Unfortunately I don't know whether the change happened after a TNG upgrade, a Google Maps mod upgrade, or a PHP/server upgrade.

Link to comment
Share on other sites

ajnsmits

Where do you set that to test LiberationSans-Regular.ttf and DejaVuSans.ttf? I think it’s being overridden again by my default font-family: “Montserrat”, sans-serif;

 

Website: ajnsmits.nl (Public / Private) / TNG 15.0.5 /  PHP 8.3.31  / MySQL 8.0.39 / Template 17 / Website hosted by: mijnhostingpartner 

On a linux server

@@character_set_database   @@collation_database  
utf8mb4 utf8mb4_general_ci
 

Schermafbeelding 2026-06-02 212007.jpg

Link to comment
Share on other sites

Janusz

Thank you.

The font-family in CSS should not affect this because the labels are generated as PNG images by google_text_marker.php using imagettftext().

Your screenshot is very helpful because it clearly shows MIEJSCOWOŚĆ rendered correctly.

My environment is also Linux with PHP 8.3 (8.3.30), GD bundled 2.1.0 and FreeType 2.12.1.

So we now know the mod itself can render Polish characters correctly. The question is what is different between our servers.

Just to clarify: the problem is not with the Polish language in TNG in general. All Polish text throughout my TNG site displays correctly. The issue only affects the labels generated under the map pins in the Google Maps 15 legend, where Polish characters are replaced with empty squares.

Link to comment
Share on other sites

ajnsmits

What you could try is opening the cust_text.php file in your pool’s languages folder in Notepad++ or a similar text editor and saving it again as a UTF-8 file. 
If I save the file as an ANSI text file, I get question marks

Schermafbeelding 2026-06-02 214022.jpg

Link to comment
Share on other sites

Janusz

I don't think the language file encoding is the cause.

I already tested by bypassing the language files completely and hardcoding the text directly in google_text_marker.php:

$string = 'PAŃSTWO';

The result was still empty squares instead of Polish characters.

So the problem occurs even when the text does not come from cust_text.php, the database or the URL parameters.

That is why I suspect a difference in the server environment rather than the language file itself.

Link to comment
Share on other sites

ajnsmits

Good morning,
I’ve had another look at my settings, and as we think it’s a server issue, could you please check the diagnostics screen in the PHP information section to see if it matches my screenshot?

Schermafbeelding 2026-06-03 094113.jpg

Link to comment
Share on other sites

Janusz

Hello,

Thank you for checking.

I compared your screenshot with my diagnostics page and all relevant GD settings appear to be enabled on my server as well, including FreeType support.

Unfortunately, the problem persists only in Google Maps pin labels, where Polish characters (ą, ć, ę, ł, ń, ó, ś, ź, ż) are rendered as squares. Other parts of TNG display these characters correctly.

For clarification, this issue is not related to TNG 15.0.5. I have experienced the same problem since TNG 14, so it has been present across multiple TNG versions.

The place names themselves display correctly throughout TNG. Only the labels shown beneath the Google Maps pins are affected. Every place, country, church, cemetery, etc. containing Polish characters is rendered as squares in the pin legend.

Could there be an issue with the font used to generate the pin legend images, or with the way Unicode/UTF-8 characters are handled when those labels are rendered?

Thank you for your help.

Best regards,
Janusz

Link to comment
Share on other sites

ajnsmits

My font is this size. Would you mind sending me your font file and cust_text.php? Then I can use them to check if they display correctly on my end.

Schermafbeelding 2026-06-03 140154.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...