Jump to content
TNG Community
pipsi

solved - WP / List_Birthdays - Problem German umlauts

Recommended Posts

pipsi

Now I have installed the TNG-WP plugin and the birthday list is running on my WP side 😉

but the German umlauts are displayed with special characters. Is this due to WP?

https://www.schuster-pippersteiner.at/

many thanks!

Ingrid

 

german umlauts.PNG

Share this post


Link to post
Share on other sites
theKiwi

Glad you got it working, but...

I hadn't noticed this in the past, but today on my site I have some instances of it also showing up, relating to curly quotes and apostrophes.

I've dug around some and I "think" I might have a fix for the extended characters problem, although it doesn't "fix" my curly quotes problem, it just strips them out. For extended characters, the fix went from this (the first line is extended characters I added to her name for testing) the lower ones are curly quotes and apostrophe

image.png

to this

image.png

The extended characters are now working, and the curly quotes and apostrophe have been stripped out. I'll keep trying to find a solution for that, but for now to fix the extended characters, do this:

Go to the WordPress directory on your site, and then plugins ------> enhanced text widget folder 

open the file enhanced-text-widget.php

Go to Line 69 and change it from 

        $text = ob_get_contents();

to

        $text = utf8_encode(ob_get_contents());

Save the changes, and see if that fixes it for you.

Or wait a few minutes - I've got a Mod Manager .cfg file that will make the change for you...

Roger

 

Share this post


Link to post
Share on other sites
pipsi

@theKiwi 

Roger - how great is that 😍

unfortunatelly the mod didn't install - target file missing

I tried also to change enhanced-text-widget.php - on line 69 there is no (see att .txt)

$text = ob_get_contents();

I found it on line 129 - changed it to

 $text = utf8_encode(ob_get_contents());

and got an error "on line 69"?!?

what should I do?

THANK you so much,

Ingrid

etw.PNG

apl.PNG

enhanced-text-widget.txt

Share this post


Link to post
Share on other sites
theKiwi

Where is your TNG install in relation to the WordPress folder?

Is TNG in the genealogie folder?

You'll need to modify the .cfg file to point to the right path from TNG/mods to the enhanced-text-widget.php file.

Try

../wp-content/plugins/enhanced-text-widget/enhanced-text-widget.php

in the .cfg file.

The file you attached is full of blank lines - that is probably why the line numbers don't line up.

What version is the enhanced-text-widget you're using?

Mine is 1.5

Roger

Share this post


Link to post
Share on other sites
pipsi
vor 14 Minuten schrieb theKiwi:

Where is your TNG install in relation to the WordPress folder?

Is TNG in the genealogie folder?

yes, TNG is in the genealogie folder

attached the .php (I att. the .txt before, sorry!)

I'm using the last version of enhanced-text-widget - Version: 1.5

I'll try to modify the .cfg !

Thank you again!
Ingrid

enhanced-text-widget.php

Share this post


Link to post
Share on other sites
pipsi

@theKiwi 

now the mod installation worked!
some German umlauts are displayed correct - BUT still some German umlauts and Czech Letters are not displayed 😉 - see att.

Ingrid

 

abdl.PNG

Share this post


Link to post
Share on other sites
theKiwi

Is your whole site - TNG and WordPress - using UTF-8? What is the database collation that you're using (look in phpMyAdmin) 

Roger

Share this post


Link to post
Share on other sites
pipsi
vor 12 Stunden schrieb theKiwi:

Is your whole site - TNG and WordPress - using UTF-8? What is the database collation that you're using (look in phpMyAdmin) 

Roger

yes, my whole site is using UTF-8.

Ingrid

WP UTF 8.PNG

UTF 8.PNG

Share this post


Link to post
Share on other sites
pipsi

@theKiwi 

I asked my provider too - the answer from the support:

According to the meta charset in your website code and according to the DB setting, both use UTF-8.
 

hope this helps ...

Ingrid

Share this post


Link to post
Share on other sites
theKiwi

Well for now I am stumped - don't know what to suggest. I'm going to write to the developer of the enhanced-text-widget and see if they have any idea what might be going on and how to fix it.

Roger

Share this post


Link to post
Share on other sites
pipsi

@theKiwi

it came to my mind that I have the "same problem" with the Czech Language in the Welcome paragraphe on the Startpage (ONLY!) - no matter if I use template 4 or (now) template 13.

Therefore I'm using HTML Unicode UTF-8 for the Czech Text - see

 

.maybe there's a connection? I wanted you to know that.

Ingrid

Share this post


Link to post
Share on other sites
XerxX

Hi,

To be honest I don't really know anything about this WP/TNG thing, but I remember that in the DB the table collation isn't just UTF-8 but - for me - it's UTF8_swedish_ci to get all the umlauts and accents correct. The result of a test I did in my TNG beginning (2013) showed that using any other, a faulty character shows up sooner or later.

I think I've read that other languages also use the same collation - but I'm Swedish so I don't have to think about it.

Maybe worth checking?

Erik

Share this post


Link to post
Share on other sites
theKiwi

Using a collation like Swedish more affects the sorting order of the characters - so that the extended characters used in Swedish sort into the correct place in the alphabet as you're used to in Sweden, rather than in say German, or French.

Using a collation like utf8_general_ci should give all characters, but the sort order for one language might not be as expected.

But in Ingrid's case, something is restricted if you can't get all characters to show correctly when typed into TNG directly.

@Ken Roy - do you recall offhand when the template settings moved from files into the database? Would something wrong there have affected @pipsi's template settings if they were copied from a file saved as ISO-8859-1 into a UTF-8 database table?

Roger

Share this post


Link to post
Share on other sites
XerxX

Thanks Roger. Yes, that rings a bell. I've used the same collation ever since w/o any thought of it.

/Erik

Share this post


Link to post
Share on other sites
pipsi

I had integrated birthday list into template 4, some days ago I changed to template 13, but I didn't want to loose the birthday list - and integrated it to WP ...

An hour ago I changed back to template 4 - so you can see it works correct ( German umlauts and Czech Letters - none today in the list  😉).

I also made some more attachments ... maybe these will help

Ingrid

June11.PNG

today.PNG

Share this post


Link to post
Share on other sites
pipsi

@theKiwi maybe this helps also - the Czech Language problem began with TNG upgrade from V12 to V12.0.2 in Oct 2019.

What do you think - should I upgrade to the latest availiable TNG version?

Ingrid

Share this post


Link to post
Share on other sites
Ken Roy

Ingrid,

Upgrading never solves these type of problems.

2 hours ago, theKiwi said:

@Ken Roy - do you recall offhand when the template settings moved from files into the database? Would something wrong there have affected @pipsi's template settings if they were copied from a file saved as ISO-8859-1 into a UTF-8 database table?

Roger,

The Template Settings were moved to the database in TNG v12.   I do not read German, but the accented characters being mangled, appear to be data related versus template related.   Also Today's birthdays script was moved from TNG to WordPress, which might also have reprecussions.

The html page heading and character encoding shown in one of the entries above is also not something that TNG generates.

While the MySQL 5 databases are UTF-8 be definition several hosting service left the collation and connection sequence at latin1_swedish_ci which results in data translation and interpretation as far as I know.  I am not a database expert. 

I don't know whether Chris Moss Changing to UTF-8 mod could be used to fix what looks like a database data problem.   I am also not sure what using html special characters for data does to the data when stored in the database.

Share this post


Link to post
Share on other sites
pipsi

@Ken Roy thank you!

just another screenshot - Today's Birthday List in Czech on template 4 - the Czech Letters work - Narození 15 Červen 2020

if I change language in TNG - the WP List changes too - and correct: Narození 15 Červen 2020

I also added two persons to TNG

  • one with German Umlauts - they are all displayed correct in the WP list, only the "ü" / "für" in the title is wrong!
  • one with Czech Letters - the name isn't displayed (in TNG ok!)!

 

 

Czech 15JUNE.PNG

G 15 June.PNG

Share this post


Link to post
Share on other sites
theKiwi

I edited a name on my website to include all of the Czech letters in it. Most of them show up correctly in the enhanced-text-widget, but a few don't - represented by a ? in this screen shot

image.png

A, a, Á, á B, b C, c, Č, č D, d, Ď, ď E, e, É, é, ě F, f G, g H, h Ch, ch I, i, Í, í J, j K, k L, l M, m N, n, Ň, ň O, o

My site is running utf8_general_ci

The letters do show correctly in TNG (in the WordPress plugin)

 

image.png

but the enhanced-text-widget is failing somehow on those few letters.

Roger

Share this post


Link to post
Share on other sites
pipsi

@theKiwi

 

vor 7 Stunden schrieb theKiwi:

Well for now I am stumped - don't know what to suggest. I'm going to write to the developer of the enhanced-text-widget and see if they have any idea what might be going on and how to fix it.

Roger

hopefully the developer of the enhanced-text-widget will have a solution!

btw. I have the same experience - e.g. á is correct in the enhanced-text-widget, but e.g. č not.

Ingrid

Share this post


Link to post
Share on other sites
pipsi

@theKiwi

as mentioned in this article I changed from template 4 to template 13, so the BIRTHDAY LIST was "lost" and therefore I wanted to integrate it into WP.

I played around a bit and was now able to successfully display the BIRTHDAY LIST in template 13. 😀

https://www.schuster-pippersteiner.at/genealogie/

So it is no longer necessary for me to display it in WP.

Roger - I thank you A LOT for your patience and solution attempts!

Ingrid

Share this post


Link to post
Share on other sites
Ken Roy

Roger,

While Ingrid has marked this particular thread as solved because she moved the Birthday lists back to TNG, i discovered something today while working on updating my cemetery database searches that are outside of TNG.

After you establish the database connection using

 $link = mysqli_connect

if your database is UTF-8 encoded, then you must also change the character set

	// Change character set to utf8
	//mysqli_set_charset($con,"utf8");
	mysqli_set_charset($link,"utf8");

I had evidently updated my hosting site script, but not that of my localhost WampServer environment.  Until, I made that change to my cemetery database searches, accented French characters were getting mangled.

I do not use WordPress so I do not know if it applies, but thought I would pass the info along.  

Share this post


Link to post
Share on other sites
theKiwi

@Ken Roy - I think that is meant to be being taken care of in the tngconnect.php file - line 102

function tng_set_charset($link, $charset) {
	return mysqli_set_charset($link, $charset);
}

which is called from Line 11 of tngconnect.php

Roger

Share this post


Link to post
Share on other sites
Ken Roy

Yes, Roger,

It is taken care of by tngconnect.php, which is why when Ingrid moved it back to TNG that it worked.

Maybe I was too cryptic.  In my veteran and cemetery database searches on my web site, I am not using TNG MySQL services.  I was passing it on as possibly something that WordPress is not handling correctly either.

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

×