Re: About Character Set
| From: | Ashley Sheridan | Date: | Sun, 17 Oct 2010 15:20:28 +0000 |
| Subject: | Re: About Character Set | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-308766@lists.php.net to get a copy of this message | ||
On Sun, 2010-10-17 at 21:56 +0800, 肖晗 wrote:
> There is a "download" directory(to provide download links) in my site.
> http://vedaclub.org/download/
> Some of the filenames contain Chinese characters, which, however cannot be
> recognized.
> Is there anything I can do to solve problem?
>
> Thanks in advance!
The short answer is "yes, remove the Chinese characters", however, I
think you were looking for something a little more automatic?
If the URL itself is causing the problem, maybe you could use the
urlencode() and urldecode() functions to make the filename for the URL
web-safe.
Another alternative that I've used before is to give each file an entry
in a DB and use a moniker to identify the file. The DB can handle all
sorts of extra functions in the future, such as allowing only specific
users to access a file, storing multiple versions of the same file
bearing the same name (on the server each version has a unique name, the
user need only know that they're requesting template.doc, version 3,
etc) and many other things.
Thanks,
Ash
http://www.ashleysheridan.co.uk