You are here: Re: Problem with addslashes « PHP Programming Language « IT news, forums, messages
Re: Problem with addslashes

Posted by Jψrn Dahl-Stamnes on 02/26/07 11:30

Willem Bogaerts wrote:

>> The problem is that this works fine on my internal test web-server
>> (running under RedHat 7.3). But on my production web-server (running
>> Fedora Core 4) it "fails". The same function create different outputs on
>> the two servers. The data on the prod server is corrupted.
>
> I don't know what you mean by corrupted. There's an awful lot of ways a
> file can be corrupted. Can this be en encoding problem? If the
> corruption occurs at special characters (accented characters, euro sign,
> etc.) and you see an "A" with an accent or tilde, then you are seeing
> utf-8 rendered as latin1 (or derivatives). If you are seeing question
> marks, the opposite is the case.

I have tested this by uploading MS Word documents to the web-server. When
downloading the data again, the client browser (FireFox) starts MS Words.
MS Word claims that the document is invalid.

The scripts works for some Word documents, but not other. The same happens
for PDF documents created with Open Office (reading MS Word docs and
exporting it to pdf files).

Also, I cannot understand why the data output from the addslashes is
different on two machiens that use the same version of PHP when the input
is the same file. It should be the same, or?

One thing I have not thought about, is the character set used in the
database. The table is created as this:

DROP TABLE IF EXISTS attachments;
CREATE TABLE attachments (
id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
title CHAR(32) NOT NULL,
filetype CHAR(32) NOT NULL,
filedata MEDIUMBLOB NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARACTER SET latin1 COLLATE latin1_danish_ci
CHECKSUM=1;

Perhaps I should alter the table and let it use utf-8 (ENGINE=MyISAM DEFAULT
CHARACTER SET utf-8...)?

And thanks for replying :-)

--
JΓΈrn Dahl-Stamnes
http://www.dahl-stamnes.net/dahls/

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация