2009-01-13

OpenSolaris can do CIFS and save my day

The OpenSolaris OpenSolaris CIFS service is really cool and has just saved me from loosing all my digital pictures. I have a laptop with XP that holds all my digital pictures (tens of thousands) and it has started to give up. XP tends to do that over time. So, I realised that I have a desktop with OpenSolaris installed since way back. It has lots of disk so I just did a 'pkg image-update' and there I was with a machine capable of acting as the family workgroup data server via CIFS. Really cool. Google for OpenSolaris CIFS workgroup to learn more. Just a couple of commands and off you go...

2009-01-06

Koha is best with Latin1

So, I've spent like 7 full working days on trying to get Koha to work with UTF-8 for no good at all. I switched all configs to Latin1 and suddenly it works somewhat better. Here's how I did;



vim /etc/apache2/apache2.conf
-----------------------------
#AddCharset UTF-8 .utf8
#AddDefaultCharset UTF-8

AddDefaultCharset ISO-8859-1
AddCharset ISO-8859-1 .iso8859-1 .latin1



vim /etc/php5/apache2/php.ini
----------------------------
#default_charset = "UTF-8"
default_charset = "ISO-8859-1"



vim /etc/mysql/my.cnf
(pid-file = /var/run/mysqld/mysqld.pid)
---------------------
#[client]
#character_set_client=utf8
#[mysql]
#default-character-set=utf8
#[mysqld]
#init-connect = 'SET NAMES utf8'
#character-set-server=utf8
#collation-server=utf8_swedish_ci



[client]
default-character-set=latin1
#[php-cgi]
#default-character-set=latin1
[mysql]
default-character-set=latin1
#[mysqladmin]
#default-character-set=latin1
[mysqlcheck]
default-character-set=latin1
[mysqldump]
default-character-set=latin1
[mysqlimport]
default-character-set=latin1
[mysqld]
init-connect='SET NAMES latin1'
character-set-server = latin1
default-character-set = latin1
collation-server=utf8_swedish_ci

Koha and UTF-8

So, once again I took the fight with Koha to make it work with non ASCII characters. I set the the following variables for MySQL, Apache and PHP


vim /etc/apache2/apache2.conf
AddCharset UTF-8 .utf8
AddDefaultCharset UTF-8

vim/etc/php5/apache2/php.ini
default_charset = "utf-8"



vim /etc/mysql/my.cnf
[client]
character_set_client=utf8
[mysql]
default-character-set=utf8
[mysqld]
init-connect = 'SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_swedish_ci

/etc/rc3.d/S19mysql restart

mysql> SHOW VARIABLES LIKE 'character_set%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.01 sec)

mysql> SHOW VARIABLES LIKE 'collation%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_swedish_ci |
| collation_server | utf8_swedish_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)





However when I try to add an item it cuts of the text at the non ASCII char. Look at these pictures:



Looks good (and a good book too)

Now I import the search result:



See, the prominent writer JMG Le Clézio is imported as "Le Cl", text cut at the é.

I can't put my finger on where the error is but it feels like it's PHP that is bugging me...

Update1: I went into the System Preferences->Intranet and changed Template Encoding to UTF-8 ( from ISO 8859-1). Guess what happened? Now the text is still cut and the non ASCII character is shown like a �

This drives me nuts...