Hello
I have a test Drupal web site.
The majority of the content is in slovak language.
I have created a story with title: Test of slovak charakters in Title (ľ,š,č,ť,ž,ý,á,í,é,ú,ä,ô,Ľ,Š,Č,Ť,Ž,Ý,Á,Í,É,Ú)
I have entered this story by going to Administer/Create Content/Story, switching my keyboard to SK - slovak (Slovakia) and typing the slovak characters.
Look at http://www.sk-bc.ca/slovo/?q=node/190
I need to export the Drupal DB.
My ISP does not offer MyPhpAdmin, so I had to write my own php scripts to export MySql table structures and data.
The script:
* extracts data from DB tables, e.g.: select * from node
* generates INSERT INTO statement, e.g.: INSERT INTO node ...
* creates a text file with the INSERT INTO statements
* offers to the client to Open or Save a text file with the INSERT INTO statements
When I extract data from the DB table, every column/value/attribute is processed like this:
$AttrValue = ....taken from the database table ....
$SlashAttrValue = addslashes($AttrValue);
if(mb_detect_encoding($SlashAttrValue)=='UTF-8'){
$Utf8SlashAttrValue = $SlashAttrValue;
}else{
$Utf8SlashAttrValue = utf8_encode($SlashAttrValue);
}
echo ($Utf8SlashAttrValue);
When I generate a text file I use
header("Content-disposition: filename=Backup.data");
header("Content-type: application/octet-stream; charset=utf-8");
header("Pragma: no-cache");
header("Expires: 0");
The file was generated.
When I open it by a text editor (notepad), it shows:
...
INSERT INTO D5_5_slovo_node (nid, vid, type, title, uid, status, created, changed, comment, promote, moderate, sticky, language, tnid, translate) VALUES
...
('190', '199', 'story', 'Test of slovak charakters in Title (?,š,?,?,ž,ý,á,Ã,é,ú,ä,ô,?,Š,?,?,ÂŽ,Ã,Ã,Ã,É,Ú)', '1', '1', '1239465107', '1239465107', '2', '0', '0', '0', '', '0', '0');
When I open it MS Word (Vista), it asks for encoding, I specify Inicode (UTF-8), and it shows:
('190', '199', 'story', 'Test of slovak charakters in Title (?,,?,?,,ý,á,í,é,ú,ä,ô,?,,?,?,,Ý,Á,Í,É,Ú)', '1', '1', '1239465107', '1239465107', '2', '0', '0', '0', '', '0', '0');
Obviously, some slovak characters have been exported correctly and some not.
Do you have any idea why?
Thank you for you time.