Wednesday, January 23, 2008

Lithuanian puzzle

This is a lithuanian puzzle about money.

Pardavėjas prekiauja kepurėmis, kurių vieneto kaina yra 10 rublių. Prieina pirkėjas, pasimatuoja vieną kepurę. Sako, kad pirksiąs ir paduoda 25 rublius.

Kadangi pardavėjas neturi grąžos, tai pasiunčia berniuką pas kaimynę pasmulkinti kupiūrų. Berniukas netrukus sugrįžta ir atiduoda pardavėjui tris kupiūras - 10 + 10 + 5. Pardavėjas įteikia pirkėjui kepurę, grąžą 15 rublių ir padėkojęs už pirkinį atsisveikina.

Po keleto valandų į parduotuvę įsiveržia pasipiktinusi kaimynė. Dar nuo slenksčio pradeda šaukti, kad tie 25 rubliai yra padirbti ir pareikalauja, kad pardavėjas grąžintų jai pinigus, nes priešingu atveju bus iškviestas žandaras.

Pardavėjas nenori kelti skandalo ir, kad ir skaudama širdimi, atsidaro kasą ir atiduoda moteriškei tuos nelemtus 25 rublius.

Klausimas. Kokį nuostolį patyrė pardavėjas?

Wednesday, January 16, 2008

Enable utf-8 support for vTiger crm

vTiger CRM team has announced that they had moved to utf-8 in the new 5.0.4 version of this open source CRM. But I had some issues in order to make it work correctly.

First of all, your database should be utf-8 compliant.

But this is not enough. If you try to import data from vTiger front-end via CSV import, you will get your data correct in the front-end, but not in the back-end :) If you look at the database, you will see that it was saved as unicode (I mean those cahracters which are from other than ISO-885-1 charset).

And even if you open your database via phpMyAdmin administration tool, and enter some new account naming it i.e. "Account Žopa", you will get "Account ?opa" from the front-end while listing Sales > Accounts.

In order to make it work correctly, you need to add the following line in the function connect in include/database/PearDatabase.php file.

$this->query("SET CHARACTER SET utf8");


This will help you to solve problems with utf-8.