View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0008353 | mantisbt | tagging | public | 2007-09-13 04:24 | 2008-08-11 09:41 |
Reporter | matthy | Assigned To | giallu | ||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.1.0a4 | ||||
Fixed in Version | 1.2.0a2 | ||||
Summary | 0008353: Handling accentuated tags | ||||
Description | Mantis doesn't accept accentuated tags like "règles" or "évolution"...
Of course, if you have a better piece of code, feel free to tell me, i'll gladly fix mine ;-) | ||||
Tags | localization, port to stable | ||||
Forgive me for my ignorance when it comes to unicode/utf/whatever. I would like to support this, but being from the US where international character support is not really taken into account, even in top-tier-university classes. I'm not familiar with how unicode/utf works across international borders and such, so bear with me please. What specifically are these changes doing? Is the ...\xc0-\xdd\xe0-xff... specifying unicode characters that are language-independent? Will these characters appear correctly to users browsing with a different language than that of the person who entered the tag name? And can you give me a one or two sentence description of the purpose for replace_accents()? Is it simply stripping out all the accents and replacing them with generic letters, or is it doing something more complicated than that? |
|
Well i tried different methods to get this result (replacing all accents by common letters so the tag is allowed)... First with replace_accents() (which i found in the php manual), but it didn't always work, there were still some unhandled characters... Since then, i've modified other pieces of code, to adapt Mantis to a french use, for example in the email stuff... I couldn't find a way to handle accents in raw text emails, so i switched everything to html and did some replace (é -> é etc); only the email subject couldn't be handled, so i used the same method as above (replace_accents(), etc). This is surely not very scientifical but my company was in a hurry to setup Mantis in time for a client, so i did it fast :) If you want, i can give you my current code, so you see where i had to handle accents. |
|
If you could make a patch against the CVS Head (I'm assuming that's what you're using due to the Product Build listed), that would be greatly appreciated, and would make it much easier to test your changes, etc. |
|
Errr... I used WinCVS to download the latest CVS build early september, but i don't know how to select some of my modifications (and not all - i changed a lot of stuff to obey our client's specifications) and put them in a patch :-\ Edit: i changed core/tag_api.php , csv_export.php , email_api.php , custom_strings_inc.php (to replace string_french accents without modifying the original file) |
|
If you can't do a diff/patch, then just zip up the affected files and attach that here. |
|
What happens if we modify the tag_name_is_valid function as follows? function tag_name_is_valid( $p_name, &$p_matches, $p_prefix="" ) { I believe it can handle any characters because Mantis 1.1.x uses utf-8. I have modified the tag_api.php locally as above, and it seems to work OK with add/remove/search operations.-- |
|
well, we do want to match spaces, underscores, periods, etc, but we don't want to match commas, plus/minus signs, and such. I also don't like the idea of just allowing everything else, but I can try to look into it. |
|
Thanks! If you need to test something, I would be glad to help :) |
|
When Mantis tags can support utf-8 non latin chars? |
|
I tried to insert tag on russian and got "Create permission denied." I do not understand what do you mean under "we do want to match spaces, underscores, periods, etc, but we don't want to match commas, plus/minus signs, and such". Match when? During check for unique? When searching? filtering? |
|
Hi konstbel,
I believe it's the same case.
When validating an user entered tag string (replacing the word 'match' with 'allow' might make more sense). -- |
|
Hi, Ave, By the way, I don't find a page of managing tags: edit, delete. Is there any? |
|
For example, '+' is used when filtering issues. Check wiki for details. http://www.mantisbt.org/wiki/doku.php/mantisbt:tagging_requirements?s=tags
Clicking one of attached tags brings you to 'Tag Details' screen. |
|
So, "as designed" you have to disallow spaces, +, - and commas. OK, we could live with that.
|
|
Giallu has mentioned that he has a patch for this issue. As I don't know enough about unicode/utf-8, I'm transferring ownership to him. |
|
Fixed with the commit at: http://mantisbt.svn.sourceforge.net/mantisbt/?rev=5437&view=rev |
|
MantisBT: master 077682f1 2008-07-28 12:55 Details Diff |
Fix 8353: Handling accentuated tags. This is done by changing the whitelisting method to a blacklist Also added proper form submission when some tags are invalid git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@5437 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9 |
Affected Issues 0008353 |
|
mod - core/tag_api.php | Diff File | ||
mod - tag_attach.php | Diff File |