Maian Script World on Facebook Maian Script World on Twitter Maian Script World - Latest News Maian Script World on YouTube Maian Script World on LinkedIn


Please Read

You are required to register before you can post. This is via a custom verification system. Please post any problems you are encountering here and I`ll do my best to respond as soon as I can. Please note that a reply WILL be posted to all queries, so do not double post. There are no guarantees when a reply will appear but I do my best to answer all within 3/4 days max. Bumping topics won`t make the slightest difference.

IMPORTANT: Posts in English ONLY please, thank you! Any other languages will be ignored and your message deleted.
SEARCH: Use the search option to see if your question has been answered on the forum before. Or check the relevant script docs.
CUSTOMER: If you have purchased a commercial version of any of my software, using the contact option at the licence centre ensures a faster response.
AUTO DELETION: Accounts older than 5 days, with no posts or topics, are automatically deleted. Only register if you are thinking of posting.
PRIVATE MESSAGES: Private messages are currently disabled.
LINKS: Any links posted are 'NOFOLLOW' and will not be picked up by search engines.

You are not logged in.

#1 28-02-2011 06:28:42

suemari
Members
Registered: 28-02-2011
Posts: 6

About utf-8 for multiple languages

Hello David,
I'm Japanese girl, just I found this great script yesterday, then installed, tested and customized.

At first I was really impressed about this script!!
But my native language "Japanese" was a problem on this script.

It seems many people had a problem about languages except English.

I'm very very beginner about PHP and MySQL, almost noting knowledge though, I really wanted to use this script, so I solved the problem from Internet smile

I think it's good for other people who wanna use this on other languages, so let me contribute some tips how I solved.

Before Install:
File: /install/index.php
It would be better to change the line from  "DEFAULT CHARSET=latin1" to "DEFAULT CHARSET=utf8".
There are 7 points on the file.
It's the time for making database on MySQL, so it make database as "utf8_general_ci" not "latin1_swedish_ci".
(I wonder why the default "latin1" makes "swedish" thgough..mystery.)

Make own language file:
Folder : /lang/
Copy "Englis.php" to "own language.php".
rewrite point:
$charset         = 'utf-8';
$mail_charset    = 'utf-8';
Save the file's character-set as "utf-8" by your editor.(This is important.)

Then set the language file on a settings of admin control.

It would be enough but when I checked MySQL database, still garbled characters.
"INSERT", "UPDATE" and "SELECT" from PHP script to MySQL, it seems set charset again...(what a complicated!)
Actually, there are a lot of point I changed though,,,
Added point :
mysql_query("INSERT...
mysql_query("UPDATE...
mysql_query("SELECT...

Added script (just before the added point):
mysql_query("SET NAMES utf8"); // for prevention garbled characters.

example1:
mysql_query("INSERT INTO ".$this->prefix."categories (
to
mysql_query("SET NAMES utf8"); // for prevention garbled characters.
mysql_query("INSERT INTO ".$this->prefix."categories (

example2:
$q_cats = mysql_query("SELECT * FROM ".$database['prefix']."categories
to
mysql_query("SET NAMES utf8"); // for prevention garbled characters.
$q_cats = mysql_query("SELECT * FROM ".$database['prefix']."categories

Files:
index.php
/admin/index.php
admin/templates/add.php
/admin/templates/approve-comments.php
/admin/templates/approve-recipes.php
/admin/templates/cats.php
/admin/templates/comments.php
/admin/templates/edit-comment.php
/admin/templates/edit.php
/admin/templates/recipes.php
/admin/templates/settings.php
/admin/control/functions.php
/admin/classes/categories.php
/admin/classes/recipes.php
/classes/class_rss.inc.php
/classes/recipes.php
/control/functions.php

(That was hard work but if I could change "my.cnf" file of MySQL directly, it'd be easy though.)
#character-set-server = latin1        // comment out default
#collation-server = latin1_general_ci // comment out defaul
default-character-set=utf8            // new setting
skip-character-set-client-handshake   // new setting

That's all just I did and it's working well big_smile
But "Search" and  "Tag Clouds" doesn't work though... I gave up this function sad

I think it'd would be great if David do something for next version***

Thank you for providing this great script for free!! I really like this!!

Sue
My web: http://en.suemari.com/
For Maian recipe(haven't made yet.): http://mayomania.com/recipe/

Last edited by suemari (04-03-2011 01:42:06)

Offline

#2 28-02-2011 11:42:35

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,063

Re: About utf-8 for multiple languages

Hey Sue,

Fantastic to hear from you and thank you for your post. What you posted is indeed correct about utf-8. To be honest I didn`t give much thoguht to foreign characters with previous versions, but I am giving it more thought now and the support should be better in future versions.

Glad you found some use for the script anyway. I`ll make this post a sticky for other people.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#3 01-03-2011 10:13:03

suemari
Members
Registered: 28-02-2011
Posts: 6

Re: About utf-8 for multiple languages

Hi David,

I'm glad to hear you think about foreign language big_smile

By the way, I'd like to write down one more tips about auto-notice e-mail for other foreign people.

Make auto-notice e-mails by own language, then save the files as utf-8 by your editor.
Folder:
/templates/email/
/admin/templates/email/

Cheers!

Sue

Offline

#4 01-03-2011 21:27:09

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,063

Re: About utf-8 for multiple languages

Thank you. smile


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#5 02-03-2011 11:33:00

lecra
Members
Registered: 13-02-2010
Posts: 33

Re: About utf-8 for multiple languages

Hi Sue,

Great what you did. I tried your changes but it seems as I would make some mistakes while after that I have a blank Settings screen in the Admin panel.

Could you make available the changed files in a zip file?

I would send you my coordinates if you agree.

br

Lecra

Offline

#6 02-03-2011 12:09:20

suemari
Members
Registered: 28-02-2011
Posts: 6

Re: About utf-8 for multiple languages

Hi Lecra,

I posted the 2 examples though, you have to pay attention about original script's structure.
But I also got same situation(blank screen) at first time, because I broke the original structure.
So I checked the position again where I added, then I noticed what wrong was.

There are few script like this structure. It was 2 or 3 points as I remember.
$SETTINGS = @mysql_fetch_object(
             mysql_query("SELECT * FROM ".$database['prefix']."settings LIMIT 1")
             );

If such a structure, you have to add new line like this, for not break the structure.
(not just before the mysql_query("...)

mysql_query("SET NAMES utf8"); // here.
$SETTINGS = @mysql_fetch_object(
             // not here.
             mysql_query("SELECT * FROM ".$database['prefix']."settings LIMIT 1")
             );

I guess you did same mistakes...because we are not programmer sad
Try it please.

Files:
index.php
admin/index.php

Sue

Last edited by suemari (02-03-2011 12:15:12)

Offline

#7 02-03-2011 14:38:28

lecra
Members
Registered: 13-02-2010
Posts: 33

Re: About utf-8 for multiple languages

Sue,

thank you so much for your fast reply! I will give them a chance this evening and come back to you with results. As I saw out of your post, seems really that I broke up the the php structure! Indeed, I'm not a php crack.....

Kind regards and cu later.

Lecra

Offline

#8 01-05-2011 22:00:52

dane86
Members
Registered: 21-01-2011
Posts: 8

Re: About utf-8 for multiple languages

Hi guys,
Some time ago I didn't know that I had to add "mysql_query("SET NAMES utf8");" to my files so I left them like they were and  with time my database was filled with garbled symbols. Note that upfront the browser is displaying the correct symbols. Now my database consists of 1200 recipes. And I ask if someone knows what would happen to the database if I add "mysql_query("SET NAMES utf8");" to the script files. Would that mess things up? Would it make the database to display correct symbols?

Best regards

Offline

#9 04-10-2011 06:28:29

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,063

Re: About utf-8 for multiple languages

dane86 wrote:

Hi guys,
Some time ago I didn't know that I had to add "mysql_query("SET NAMES utf8");" to my files so I left them like they were and  with time my database was filled with garbled symbols. Note that upfront the browser is displaying the correct symbols. Now my database consists of 1200 recipes. And I ask if someone knows what would happen to the database if I add "mysql_query("SET NAMES utf8");" to the script files. Would that mess things up? Would it make the database to display correct symbols?

Best regards

Hi Dane,

Sorry I never saw this one. No, this should make no difference. It is the correct thing to do.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

Board footer

2Checkout.com is an authorized reseller of goods and services provided by Maian Script World.© 2003-2013 David Ian Bennett. All Rights Reserved | Forum: FluxBB

Privacy Policy | Refund Policy