Jump to content
TNG Community
klooster

PDF special characters problem

Recommended Posts

klooster

Strange problem, all my TNG database files are: utf8_general_ci.

NO problem with special characters when viewing a page, check out: Hélène de Koning and printscreen.

But when I create a PDF of the individual the special characters do no show (see printscreen).

Any ideas about this problem?

And how to solve this ???

 

Schermafbeelding 2021-04-09 om 16.34.50.png

Schermafbeelding 2021-04-09 om 16.34.59.png

Schermafbeelding 2021-04-09 om 16.34.37.png

Share this post


Link to post
Share on other sites
theKiwi

Is it the same if you click on "Font" and choose a different font?

image.png

 

You could also try this - delete the entire font folder from your site, and then upload a new copy of it and its contents from a full TNG install of the same version as your site.

See if that changes anything.

Roger

Share this post


Link to post
Share on other sites
Katryne

Hello Cees ! It's not only for pdf.

I see the characters display problem in the title of my browser tab, since it takes from the Title tab of your page .

This looks like a charset problem. Display your page in source mode and you will see :

<title>Helena Theodora "Hélène" DE KONING b. 28 Apr 1949 Medemblik, Nederland: Kloosterman Genealogy and Emigrants to America</>
title>
 
<meta name="Description" content="Helena Theodora "Hélène" DE KONING b. 28 Apr 1949 Medemblik, Nederland: Kloosterman Genealogy and Emigrants to America" />

 

 

Share this post


Link to post
Share on other sites
theKiwi

Now I've looked at her page - it's every instance of her name on the page

image.png

 

and then down in the photos section too

image.png

Roger

Share this post


Link to post
Share on other sites
klooster

That's strange because when I look at the source code (Chrome browser)  all is oké, special  characters are displayed, also no problem on the person page, see first 2 printscreens

BUT with Safari there is the problem as you described, see last printscreen

No idea how to solve this, all tables are  utf8_general_ci.

??????

 

PS: uploading new fonts folder as suggested did not solve the problem

Schermafbeelding 2021-04-10 om 07.25.32.png

Schermafbeelding 2021-04-10 om 07.24.22.png

Schermafbeelding 2021-04-10 om 07.30.11.png

Share this post


Link to post
Share on other sites
klooster

I cleared cache, reloaded Safari browser, page is displayed oke, now only problem here also the PDF chart, see two SAFARI print screens

Schermafbeelding 2021-04-10 om 07.52.31.png

Schermafbeelding 2021-04-10 om 07.54.31.png

Share this post


Link to post
Share on other sites
fluffy82
2 hours ago, klooster said:

That's strange because when I look at the source code (Chrome browser)  all is oké, special  characters are displayed, also no problem on the person page, see first 2 printscreens

I'm on Chrome too, and I only see the code in both the page display and the page source.

display: "HéLèNE"

Source: &quot;Hélène&quot;

Share this post


Link to post
Share on other sites
klooster

Strange, cleared cache. Changed all the collatation to UTF8_Swedish_ci. Did not solve the problem ????

In my Chrome (iMac) everything is oke, in safari not.

Share this post


Link to post
Share on other sites
klooster

Text may be garbled in SAFARI if a webpage uses characters that aren’t part of the default text encoding and the page doesn’t specify the correct encoding.

 

  • In the Safari app 6846073fc6f766d1ad3f66ae757c5e24.png on your Mac, choose View > Text Encoding.

  • I did that and changed the standard encoding to UTF-8, page looks oke now in Safari, but nof the OPDF

Share this post


Link to post
Share on other sites
klooster

I changed all the Hélène into H&#233;l&egrave;ne and saved everything. It shows oke now in Safari, but still the PDF problem

Share this post


Link to post
Share on other sites
theKiwi

Looking at the source code of your page Line 8

<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />

Line 113

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

The first seems to come from TNG, the second from your WordPress theme.

1 hour ago, klooster said:

I changed all the Hélène into H&#233;l&egrave;ne and saved everything. It shows oke now in Safari, but still the PDF problem

This isn't fixing the problem - it's only hiding the problem from the web browser, but as you note, the PDF is still wrong - that's because PDF doesn't deal with html entities, and so just displays what you've entered

image.png

Has this always been a problem that you've just discovered, or was it OK until something unknown happened to change it?

Do you do this data entry in TNG, or by importing a GEDCOM file?

Is this the only person on your site with accented characters?

Roger

Share this post


Link to post
Share on other sites
klooster

I never noticed the PDF problem, I received an email from someone who pointed it to me out.

I import form Reunion Gedcom export, but sometimes the Nickname manually, in th is case manually

Share this post


Link to post
Share on other sites
theKiwi
5 hours ago, klooster said:

I import form Reunion Gedcom export, but sometimes the Nickname manually, in th is case manually

Now it is displaying properly - did you do a new import, or...?

There are 13 instances of Hélène on that page and they all show correctly, and in the PDF now

Roger

 

Share this post


Link to post
Share on other sites
klooster

Hi Roger,

Wel I fixed the problem with trial and error. 

  • Uploading new fonts folder as suggested did not solve the problem. 
  • Changed all the collatation to UTF8_Swedish_ci. did not solve the problem

Then I thought, well it could be the font I am using that causes the problem, because in my WP Theme I use a GoogleFont, Open Sans and in my non-TNG pages all the special characters display without a problem.

So maybe the Google font, Open Sans is not lading in my TNG files or there is a conflict. First I tried to force the Open Sans font, in the TNG pages through the WP Customise css option, with:

  • /* START TNG NORMAL FONT - normal: most regular TNG body text */
    .normal {
    font-family: 'Open Sans', Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    font-weight: 400 !important;
    }
    /* END TNG NORMAL FONT - normal: most regular TNG body text */

That did not solve the problem, so maybe the Google Font was not available or not loading in the TNG pages, so I did put this in my TNG meta.php:

  • <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700' rel='stylesheet' type='text/css'> 

WELL THAT DID THE TRICK.

PROBLEM SOLVED!!!

Thank you all for taking the time to respond!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×