472,121 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,121 software developers and data experts.

Re: Uploading files with speical characters....

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
2 2211
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
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.

Similar topics

4 posts views Thread by dickiedyce | last post: by
10 posts views Thread by John Smith | last post: by
5 posts views Thread by Chris | last post: by
3 posts views Thread by muziburrehaman | last post: by
11 posts views Thread by starter08 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.