{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/33089798","id":33089798,"diff_hunk":"@@ -1050,16 +1050,37 @@ public static bool TryDecode(ImmutableArray<byte> bytes)\n \n         /// <summary>\n         /// Given an input string changes it to be acceptable as a part of a type name.\n-        /// For now we will simply replace '.' with '_'as the most common case.\n         /// </summary>\n         internal static string MangleForTypeNameIfNeeded(string moduleName)\n-        {\n-            // TODO: it may make sense to strenthen this algorithm \n-            //       to result in 1-1 mapping to reduce chances of\n-            //       producing matching results for distinct original strings\n-            var result = moduleName.Replace('.', '_');\n+        {            \n+            var s = new StringBuilder();\n+            foreach (var c in moduleName)\n+            {\n+                //Any character that can appear in an identifier maps to itself, except Q and _\n+                var qOr_ = (c == 'Q' || c == '_');\n+                if ((!qOr_) && char.IsLetterOrDigit(c))\n+                {\n+                    s.Append(c);\n+                    continue;\n+                }\n+                switch (c)\n+                {\n+                    case ('Q'): //Q maps to QQ\n+                        s.Append(\"QQ\");\n+                        break;\n+                    case ('_'): //_ maps to Q_\n+                        s.Append(\"Q_\");\n+                        break;\n+                    case ('.'): //. maps to _\n+                        s.Append('_');\n+                        break;\n+                    default: //any other character maps to Q followed by four hex digits for its unicode value.\n+                        s.AppendFormat(\"{0}{1:X}\", 'Q', c);","path":"src/Compilers/Core/Portable/MetadataReader/MetadataHelpers.cs","position":53,"original_position":53,"commit_id":"476eb5d1f1f12aeee4150d552d5f32bd91b122de","original_commit_id":"476eb5d1f1f12aeee4150d552d5f32bd91b122de","user":{"login":"tmat","id":41759,"avatar_url":"https://avatars.githubusercontent.com/u/41759?v=3","gravatar_id":"","url":"https://api.github.com/users/tmat","html_url":"https://github.com/tmat","followers_url":"https://api.github.com/users/tmat/followers","following_url":"https://api.github.com/users/tmat/following{/other_user}","gists_url":"https://api.github.com/users/tmat/gists{/gist_id}","starred_url":"https://api.github.com/users/tmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmat/subscriptions","organizations_url":"https://api.github.com/users/tmat/orgs","repos_url":"https://api.github.com/users/tmat/repos","events_url":"https://api.github.com/users/tmat/events{/privacy}","received_events_url":"https://api.github.com/users/tmat/received_events","type":"User","site_admin":false},"body":"I don't follow why do we need to replace any characters by their UTF16 code?","created_at":"2015-06-23T20:43:22Z","updated_at":"2015-06-23T20:43:22Z","html_url":"https://github.com/dotnet/roslyn/pull/2396#discussion_r33089798","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/2396","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/33089798"},"html":{"href":"https://github.com/dotnet/roslyn/pull/2396#discussion_r33089798"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/2396"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/2396","id":34427934,"html_url":"https://github.com/dotnet/roslyn/pull/2396","diff_url":"https://github.com/dotnet/roslyn/pull/2396.diff","patch_url":"https://github.com/dotnet/roslyn/pull/2396.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/2396","number":2396,"state":"open","locked":false,"title":"Implement 1-to-1 anonymous class module name mangling for netmodules","user":{"login":"weswigham","id":2932786,"avatar_url":"https://avatars.githubusercontent.com/u/2932786?v=3","gravatar_id":"","url":"https://api.github.com/users/weswigham","html_url":"https://github.com/weswigham","followers_url":"https://api.github.com/users/weswigham/followers","following_url":"https://api.github.com/users/weswigham/following{/other_user}","gists_url":"https://api.github.com/users/weswigham/gists{/gist_id}","starred_url":"https://api.github.com/users/weswigham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weswigham/subscriptions","organizations_url":"https://api.github.com/users/weswigham/orgs","repos_url":"https://api.github.com/users/weswigham/repos","events_url":"https://api.github.com/users/weswigham/events{/privacy}","received_events_url":"https://api.github.com/users/weswigham/received_events","type":"User","site_admin":false},"body":"As discussed in #1428\r\n\r\n<!---\r\n@huboard:{\"order\":3498.0,\"milestone_order\":2396,\"custom_state\":\"\"}\n-->\r\n","created_at":"2015-04-30T04:37:36Z","updated_at":"2015-06-23T20:43:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a3935d997473dd216edba1b2c0c2b67262a351c","assignee":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/3","html_url":"https://github.com/dotnet/roslyn/milestones/1.1","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/3/labels","id":937401,"number":3,"title":"1.1","description":"This is our 1.1 Milestone.\r\n\r\n<!---\r\n@huboard:{\"order\":1.5}\r\n-->\r\n","creator":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"open_issues":358,"closed_issues":64,"state":"open","created_at":"2015-01-15T20:48:41Z","updated_at":"2015-06-23T20:23:15Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/2396/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/2396/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/2396/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/476eb5d1f1f12aeee4150d552d5f32bd91b122de","head":{"label":"weswigham:master","ref":"master","sha":"476eb5d1f1f12aeee4150d552d5f32bd91b122de","user":{"login":"weswigham","id":2932786,"avatar_url":"https://avatars.githubusercontent.com/u/2932786?v=3","gravatar_id":"","url":"https://api.github.com/users/weswigham","html_url":"https://github.com/weswigham","followers_url":"https://api.github.com/users/weswigham/followers","following_url":"https://api.github.com/users/weswigham/following{/other_user}","gists_url":"https://api.github.com/users/weswigham/gists{/gist_id}","starred_url":"https://api.github.com/users/weswigham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weswigham/subscriptions","organizations_url":"https://api.github.com/users/weswigham/orgs","repos_url":"https://api.github.com/users/weswigham/repos","events_url":"https://api.github.com/users/weswigham/events{/privacy}","received_events_url":"https://api.github.com/users/weswigham/received_events","type":"User","site_admin":false},"repo":{"id":34833413,"name":"roslyn","full_name":"weswigham/roslyn","owner":{"login":"weswigham","id":2932786,"avatar_url":"https://avatars.githubusercontent.com/u/2932786?v=3","gravatar_id":"","url":"https://api.github.com/users/weswigham","html_url":"https://github.com/weswigham","followers_url":"https://api.github.com/users/weswigham/followers","following_url":"https://api.github.com/users/weswigham/following{/other_user}","gists_url":"https://api.github.com/users/weswigham/gists{/gist_id}","starred_url":"https://api.github.com/users/weswigham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weswigham/subscriptions","organizations_url":"https://api.github.com/users/weswigham/orgs","repos_url":"https://api.github.com/users/weswigham/repos","events_url":"https://api.github.com/users/weswigham/events{/privacy}","received_events_url":"https://api.github.com/users/weswigham/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weswigham/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/weswigham/roslyn","forks_url":"https://api.github.com/repos/weswigham/roslyn/forks","keys_url":"https://api.github.com/repos/weswigham/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weswigham/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weswigham/roslyn/teams","hooks_url":"https://api.github.com/repos/weswigham/roslyn/hooks","issue_events_url":"https://api.github.com/repos/weswigham/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/weswigham/roslyn/events","assignees_url":"https://api.github.com/repos/weswigham/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/weswigham/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/weswigham/roslyn/tags","blobs_url":"https://api.github.com/repos/weswigham/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weswigham/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weswigham/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/weswigham/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weswigham/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/weswigham/roslyn/languages","stargazers_url":"https://api.github.com/repos/weswigham/roslyn/stargazers","contributors_url":"https://api.github.com/repos/weswigham/roslyn/contributors","subscribers_url":"https://api.github.com/repos/weswigham/roslyn/subscribers","subscription_url":"https://api.github.com/repos/weswigham/roslyn/subscription","commits_url":"https://api.github.com/repos/weswigham/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/weswigham/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/weswigham/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/weswigham/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/weswigham/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/weswigham/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weswigham/roslyn/merges","archive_url":"https://api.github.com/repos/weswigham/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weswigham/roslyn/downloads","issues_url":"https://api.github.com/repos/weswigham/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/weswigham/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/weswigham/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/weswigham/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weswigham/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/weswigham/roslyn/releases{/id}","created_at":"2015-04-30T04:04:06Z","updated_at":"2015-05-07T18:35:11Z","pushed_at":"2015-06-17T04:44:19Z","git_url":"git://github.com/weswigham/roslyn.git","ssh_url":"git@github.com:weswigham/roslyn.git","clone_url":"https://github.com/weswigham/roslyn.git","svn_url":"https://github.com/weswigham/roslyn","homepage":"","size":75321,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"0f227ae89bd8c2a5db82c70fc6d25f013f390cd4","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","created_at":"2015-01-11T02:39:03Z","updated_at":"2015-06-23T18:32:52Z","pushed_at":"2015-06-23T19:03:07Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":145662,"stargazers_count":2541,"watchers_count":2541,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":552,"mirror_url":null,"open_issues_count":996,"forks":552,"open_issues":996,"watchers":2541,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/2396"},"html":{"href":"https://github.com/dotnet/roslyn/pull/2396"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/2396"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/2396/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/2396/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/2396/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/476eb5d1f1f12aeee4150d552d5f32bd91b122de"}}}}