|
|
| Author |
Message |
koun Second Lieutenant


Joined: 19 Aug 2003 Posts: 110 Location: Greece
|
Posted: Sun Oct 12, 2003 8:34 am Post subject: Encyclopedia Module with terms in non-english language |
|
|
|
| I am trying to make a list in the encyclopedia module using the greek language, and it cant recogize it ! If i try to add a term in english it works fine but when i try in greek it dont show up! |
|
| Back to top |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6257 Location: Outer Space
|
Posted: Sun Oct 12, 2003 11:38 am Post subject: |
|
|
|
First, make sure that the MySQL server uses the right character encoding. From the MySQL manual on The Character Set Used for Data and Sorting:
| Quote: | By default, MySQL uses the ISO-8859-1 (Latin1) character set with sorting according to Swedish/Finnish. This is the character set suitable in the USA and western Europe.
All standard MySQL binaries are compiled with --with-extra-charsets=complex. This will add code to all standard programs to be able to handle latin1 and all multi-byte character sets within the binary. Other character sets will be loaded from a character-set definition file when needed.
The character set determines what characters are allowed in names and how things are sorted by the ORDER BY and GROUP BY clauses of the SELECT statement.
You can change the character set with the --default-character-set option when you start the server. The character sets available depend on the --with-charset=charset and --with-extra-charsets= list-of-charset | complex | all | none options to configure, and the character set configuration files listed in `SHAREDIR/charsets/Index'.
 |
From what I can read in the comments for the German character set, if you change the default character encoding of mysqldd after you have already entered some texts with a different character set previously, you will have to export the database and reimport it, for all texts to be stored with the right character encoding. "REPAIR" or "MYISAMCHECK" will not help, even if the documentation wants to make us believe they will. You can see the character set used in a table by issuing the command
| Code: |
myisamchk -dvv table.MYI
|
If it is not the one you want, then the only thing that helps is to export the DB and reimport it with:
| Code: |
Export:
mysqldump --all-databases --add-drop-table > backup.sql
Import:
mysql -lL < backup.sql
|
Your character encoding should be set to greek, see the Table with Character Sets and Corresponding 4.1 Character Set/Collation Pairs.
Now what if you want to mix chinese and greek together? Then your best bet would be to go with Unicode.
There's more to this topic, stay tuned... _________________ Regards
Chris Karakas
www.karakas-online.de
Last edited by chris on Wed Dec 31, 2003 12:08 am; edited 1 time in total |
|
| Back to top |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6257 Location: Outer Space
|
Posted: Sun Oct 12, 2003 12:06 pm Post subject: |
|
|
|
Even if you set the character encoding correctly in MySQL, you may still want to change the $alphabet array in the alpha() function of modules/Encyclopedia/index.php:
| Code: |
$alphabet = array ("A","B","C","D","E","F","G","H","I","J","K","L","M",
"N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
|
Add your greek letters there, either by intermixing them with the english ones, or by deleting the english ones alltogether.
The way all this works is by constructing a database query that finds all entries of the given encyclopedia id having a title which, when transformed to all uppercase, starts "like" the given letter, where the letter can only be one of the entries in the $alphabet array. See for yourself in function terms() of modules/Encyclopedia/index.php:
| Code: |
$sql = "SELECT tid, title FROM ".$prefix."_encyclopedia_text WHERE UPPER(title) LIKE '$ltr%' AND eid='$eid'";
|
_________________ Regards
Chris Karakas
www.karakas-online.de |
|
| Back to top |
|
 |
koun Second Lieutenant


Joined: 19 Aug 2003 Posts: 110 Location: Greece
|
Posted: Mon Oct 13, 2003 6:46 am Post subject: thanks |
|
|
|
| Thanks Chris it is working now ! |
|
| Back to top |
|
 |
saxinidis Lance Corporal

Joined: 09 Jan 2005 Posts: 9 Location: grece
|
Posted: Thu Jan 13, 2005 3:37 pm Post subject: |
|
|
|
This solution is for the encyclopedia module is not for the module weblinks.
I need to fix the sorting problem with greek characters in weblinks module.
Thanks |
|
| Back to top |
|
 |
chris Dark Lord of the Sith

Joined: 10 May 2003 Posts: 6257 Location: Outer Space
|
Posted: Thu Jan 13, 2005 11:21 pm Post subject: |
|
|
|
Well, not exactly. In this thread there are other tips too - tips that apply generally, irrespectively of the module used.
Did you make sure your MySQL server uses the right character encoding, for example? If you changed the character encoding now, did you export and reimport the database as suggested? _________________ Regards
Chris Karakas
www.karakas-online.de |
|
| Back to top |
|
 |
saxinidis Lance Corporal

Joined: 09 Jan 2005 Posts: 9 Location: grece
|
Posted: Fri Jan 14, 2005 1:51 pm Post subject: |
|
|
|
No, i didnot export and reimport the database !!
Sorry!!
But the database is more than 10Mb i need to do in all database or in some tables only?
And the problem i have it and local too.
Only if i change the character set to mysql (my.ini - greek) it works local propably. |
|
| Back to top |
|
 |
artd Private

Joined: 08 Jan 2008 Posts: 1
|
Posted: Tue Jan 08, 2008 1:28 pm Post subject: |
|
|
|
when i try to import i got
| Code: | CREATE TABLE `nuke_encyclopedia` (
`eid` int( 10 ) NOT NULL AUTO_INCREMENT ,
`title` varchar( 255 ) CHARACTER SET latin5 NOT NULL default '',
`description` text CHARACTER SET latin5 NOT NULL ,
`elanguage` varchar( 30 ) CHARACTER SET latin5 NOT NULL default '',
`active` int( 1 ) NOT NULL default '0',
PRIMARY KEY ( `eid` ) ,
KEY `eid` ( `eid` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =8; |
MySQL:
| Code: | | #1050 - Table 'nuke_encyclopedia' already exists |
it says file is already exsist..
What i have to do ? i use Nuke 7.9
Best wishes
[edit] Included code in code tags. Floren [/edit] |
|
| Back to top |
|
 |
|
|
 |
|
|