-
The idea in the link you posted makes sense if you have a few characters that are strange (such as accent marks in Spanish or French), but if you have no characters that will be properly displayed (as in Chinese or Japanese, or anything else with a completely different writing system), there is no point in using that. I'd suggest using md5() to create a "random" name that probably won't overlap with any other names. It won't look pretty, but it won't be any worse than urlencode().
You can't use the Latin-alphabet forms? I don't see why not, except that it might be difficult to convert them. Google translate can do this automatically, but with their recent decision to not allow use of the API except as a paid service, that might not work for you. I'm sure that if you're willing to pay you can find a way to convert that way. And you might be surprised how many of your uses can understand the Romanization of the Asian scripts-- that's generally how they type anyway, based on the sounds of the characters.
You can't use the badly encoded string because it won't make sense. You need to investigate the character encodings at EVERY step in your process and figure out where it is going wrong. As I said before, you need to convert to the correct format as needed. My first guess would be to convert from UTF8 (the input) to whatever your OS uses by default, but there might be more complications involved.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
The Following User Says Thank You to djr33 For This Useful Post:
-
if this

Originally Posted by
ggalan
手袋
and this

Originally Posted by
ggalan
帽子
result from the same input, then you've definitely got character encoding issues. If you're handling characters like this, you need to be using utf-8 for everything. Getting php (or a database, or your text editor), to use utf-8 is relatively easy. Getting your server's filesystem to play along when you create the directories might be more difficult (especially if you don't admin your own server).
Honestly, whatever solution you find will probably need to be server-specific (non-portable). I would recommend using a different naming scheme for your actual directories, and using "pretty urls" -either via php or .htaccess- to map the desired paths (with the desired characters) to the correct locations.
Last edited by traq; 10-24-2011 at 04:06 AM.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks