PDA

View Full Version : Encoding Problem


starks
01-05-2005, 08:39 PM
Hello,

I just installed phpdig and like it a lot. But I'm having problems implementing the ISO-8859-9 encoding. I searched the forum and found some threads on this subject but they were quite old. Since there are some new versions available, I was wondering if the way to add them is still the same.

I looked at this thread (http://www.phpdig.net/forum/showthread.php?t=93) but I'm confused.

Mr Charter says...

In the config file, the variable $phpdig_string_subst['iso-8859-1'] has the letter A followed by the colon and then other letter A's with accents. For example A:ÀÁÂÃÄÅ and so forth.

Try making $phpdig_string_subst['iso-8859-5'] in the same form as $phpdig_string_subst['iso-8859-1'] and $phpdig_string_subst['iso-8859-2'].


So, do I just add only the characters that are not available in other character sets?

For example, should I create line something like this?

$phpdig_string_subst['iso-8859-9'] = 'put the different characters here';

I don't understand the purpose of the colons. If somebody can show me for just one character, I think I can go from there.

Thank you.

Charter
01-05-2005, 11:06 PM
Remove any spaces in each line, and try using the following in the config file.

define('PHPDIG_ENCODING','iso-8859-9');

$phpdig_string_subst['iso-8859-9'] = '*:À,á:Á,â:Â,ã:Ã,ä:Ä,å:Å,æ:Æ,ç:Ç,è:È,é:É,ê:Ê,ë:Ë,ì :Ì,*:Í,î:Î,ï:Ï,ð:Ð,ñ:Ñ,ò:Ò,ó:Ó,ô:Ô,õ:Õ,ö:Ö,÷:×,ø:Ø ,ù:Ù,ú:Ú,û:Û,ü:Ü,ý:Ý,þ:Þ,ÿ:ß';

$phpdig_words_chars['iso-8859-9'] = '[:alnum:]ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß*áâãä æçèéêëì*îïðñòóôõö÷øùúûüýþÿ';

starks
01-06-2005, 12:26 AM
Thank you very much! :) It worked great except for one thing.

When I insert "define('PHPDIG_ENCODING','iso-8859-9');" , encoding problem is totally gone, but search can not find most of the results. When I change it to 8859-1 and search with the same keyword, it finds a lot of results.

Could it because I indexed using 8859-1? Would it help if I clear the index and make another one by using 8859-9? Or is that irrelevant?

Again, thank you so much. :)

starks
01-06-2005, 02:21 PM
After further inspection I found out that the above problem occurs only when more than one keyword is entered.

For example, if I enter "bruce", it works great. But if I enter "bruce campbell", then it does not find anything. (finds a lot with 8859-1). I looked at the admin panel >last search queries and it shows the keyword as this: bruceòcampbell

So, it somehow converts the space character to the "ò" character, thus it can't find any results.

Charter
01-06-2005, 06:12 PM
The issue may be that you indexed using iso-8859-1 but now want search results displayed as iso-8859-9 so try a reindex and search on a site that is encoded iso-8859-9, and set PhpDig to use iso-8859-9 for everything.