Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Problem with charset

$
0
0

Replies: 1

Hello!
I use WordPress and I have problem retrieving data from another database.
I’m not a developer and my english sucks ;-(

A frienf of mine uses a 20 year old programm and from there he stores his data to a database ( using stripslashes() in his programm files). Tables type is MyISAM and the Collation: latin1_swedish_ci
eg. ΠΡΩΤΑΘΛΗΑΜΑ ( translation = championship ) stored like ÐÑÙÔÁÈËÇÌÁ

I recenlty install WordPress in a subfolder of his hosting using
define(‘DB_CHARSET’, ‘utf8’);
define(‘DB_COLLATE’, ”);
on wp-config.php

Evrything works fine with greek 4 me but now I want to get data from his old database 🙁

Our server runs php 5.5.38, MySql 5.5.57 and Server charset: UTF-8 Unicode (utf8)

I thought 2 solutions..

1)Making a plugin. Fold!
I copy & paste 3 files from his old site to /plugins/my-folder/

The main file is initialize_database.php which sets the database pconnect info.
The other 2 files are OnePage.php and OnePage.inc
The OnePage.php includes initialize_database.php & OnePage.inc

Everything was ÐÑÙÔÁÈËÇÌÁ until I insert to the start of OnePage.inc
<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html; charset=windows-1253″>
<TITLE>My Title</TITLE>
<link rel=”stylesheet” href=”rollover” type=”text/css”>
</HEAD>

Now I have a page in WordPress with no stylesheet which uses charset=windows-1253 and shows my old database data in greek just fine. I also copied SecondPage.php & SecondPage.inc which get variables from One.Page and works too!

2)My thought was that everything is simple now.
I have to insert <meta charset=”windows-1253″ /> to the <head> section of my <header>.

I’m using a child theme so I started by make a template-my_template.php file in my parent-theme/folder,
which get_header( ‘my-new-header’ ); ?>
Make a header-my-new-header.php in my child-theme/folder and content-new-content.php which in the includes initialize_database.php and OnePage.inc before the </article> tag.

Made a new page using my-new-template and still retrives data in ÐÑÙÔÁÈËÇÌÁ.

What am I doing wrong??


Viewing all articles
Browse latest Browse all 59525

Trending Articles