3

Display names seem to be able to use full-on Unicode, but this is not so for at-mentions (Comment-replies).
At the very least, spaces are stripped when doing an at-mention for Test User; this would become @TestUser in a reply comment.

How are display names processed to produce this string?

1 Answer 1

3

See "How do comment @replies work?" and "@Peter works for Péter Török?".

Comment replies will often work with unicode. EG: Péter Török can be reached by both @Peter and @Péter.


These are the documented rules (Not checked against latest source) for converting user display_name to comment-reply @names:

  1. Remove any spaces.
  2. Single quotes, dots, dashes and underscores should not be removed.
  3. Special characters are replaced with their simple equivalent.
    The rules for that were last documented in this answer from Jeff Atwood. For convenience the last posted remap code was:
public static string RemapInternationalCharToAscii (char c) {
    string s = c.ToString ().ToLowerInvariant ();
    if ("àåáâäãåą".Contains (s) ) {
        return "a";
    } else if ("èéêëę".Contains (s) ) {
        return "e";
    } else if ("ìíîïı".Contains (s) ) {
        return "i";
    } else if ("òóôõöøőð".Contains (s) ) {
        return "o";
    } else if ("ùúûüŭů".Contains (s) ) {
        return "u";
    } else if ("çćčĉ".Contains (s) ) {
        return "c";
    } else if ("żźž".Contains (s) ) {
        return "z";
    } else if ("śşšŝ".Contains (s) ) {
        return "s";
    } else if ("ñń".Contains (s) ) {
        return "n";
    } else if ("ýÿ".Contains (s) ) {
        return "y";
    } else if ("ğĝ".Contains (s) ) {
        return "g";
    } else if (c == 'ř') {
        return "r";
    } else if (c == 'ł') {
        return "l";
    } else if (c == 'đ') {
        return "d";
    } else if (c == 'ß') {
        return "ss";
    } else if (c == 'Þ') {
        return "th";
    } else if (c == 'ĥ') {
        return "h";
    } else if (c == 'ĵ') {
        return "j";
    } else {
        return "";
    }
}
1
  • 1
    I'll note to any StackExchange staff reading this post: the comment discussion on Jeff's answer remains seemingly unresolved. Using the official Unicode translation tables would be a lot better – everyone can implement the same standard :) Commented Dec 4, 2014 at 2:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .