By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,341 Members | 1,396 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,341 IT Pros & Developers. It's quick & easy.

Re: Uploading files with speical characters....

P: n/a
jodleren escribió:
I work on s system, which is based on one.com (Denmark) - and used
elsewhere, in my case in the baltics.
When uploading files, there is problem with Lativian characters - the
e with overscore (e with a line above; ē )

The problem is, that when uploading, it changes the "e" to the html
code:

echo "\r\n10- ".$_FILES["newfile_$i"]['name']."<br>";
result:
whatever_ē.pdf
I haven't found the PHP manual page where such feature is documented but
a few tests have shown that this behaviour changes depending on the
charset parameter of the "Content-Type" HTTP header; even if I don't set
an actual HTTP header and I just use a <metatag:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

With a packet sniffer I've determined that it's not the browser who
changes it. If you write into a file the entities are still there, so it
doesn't seem to be an Apache feature. It's really weird.

If it's not feasible to change your encoding to UTF-8, well, I don't
know what you can do...
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 17 Jun, 11:46, "Álvaro G. Vicario"
<alvaroNOSPAMTHA...@demogracia.comwrote:
jodleren escribió:
I work on s system, which is based on one.com (Denmark) - and used
elsewhere, in my case in the baltics.
When uploading files, there is problem with Lativian characters - the
e with overscore (e with a line above; ē )
The problem is, that when uploading, it changes the "e" to the html
code:
echo "\r\n10- ".$_FILES["newfile_$i"]['name']."<br>";
result:
whatever_ē.pdf

I haven't found the PHP manual page where such feature is documented but
a few tests have shown that this behaviour changes depending on the
charset parameter of the "Content-Type" HTTP header; even if I don't set
an actual HTTP header and I just use a <metatag:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

With a packet sniffer I've determined that it's not the browser who
changes it. If you write into a file the entities are still there, so it
doesn't seem to be an Apache feature. It's really weird.

If it's not feasible to change your encoding to UTF-8, well, I don't
know what you can do...

--
--http://alvaro.es- Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:http://bits.demogracia.com
-- Mi web de humor al baño María:http://www.demogracia.com
--
I have the same problem but with uploading excel files to mysql 5. It
doesn't matter if I use UTF-8 or iso-8859-1 and uploading the
trademark symbol. htmlspecialchars() or htmletities() doesn't help?
Jun 27 '08 #2

P: n/a
On Jun 17, 5:31Â*pm, matech <robert.mat...@hotmail.co.ukwrote:
On 17 Jun, 11:46, "Álvaro G. Vicario"

<alvaroNOSPAMTHA...@demogracia.comwrote:
jodleren escribió:
I work on s system, which is based on one.com (Denmark) - and used
elsewhere, in my case in the baltics.
When uploading files, there is problem with Lativian characters - the
e with overscore (e with a line above; ē )
The problem is, that when uploading, it changes the "e" to the html
code:
echo "\r\n10- ".$_FILES["newfile_$i"]['name']."<br>";
result:
whatever_ē.pdf
I haven't found the PHP manual page where such feature is documented but
a few tests have shown that this behaviour changes depending on the
charset parameter of the "Content-Type" HTTP header; even if I don't set
an actual HTTP header and I just use a <metatag:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
With a packet sniffer I've determined that it's not the browser who
changes it. If you write into a file the entities are still there, so it
doesn't seem to be an Apache feature. It's really weird.
If it's not feasible to change your encoding to UTF-8, well, I don't
know what you can do...
--
--http://alvaro.es-Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:http://bits.demogracia.com
-- Mi web de humor al baño MarÃ*a:http://www.demogracia.com
--

I have the same problem but with uploading excel files to mysql 5. It
doesn't matter if I use UTF-8 or iso-8859-1 and uploading the
trademark symbol. htmlspecialchars() or htmletities() doesn't help?- Hidequoted text -
I tried some of these, no luck.

I made a replace for known letters ( e.g. ē =e ) end for the
rest I just replace them with _ (underscore)
That way I can avoid any problems.
I am just wondering when they start using russian letters in
filenames... hope they wont

/S
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.