{"action":"closed","issue":{"url":"https://api.github.com/repos/idno/Known/issues/1059","labels_url":"https://api.github.com/repos/idno/Known/issues/1059/labels{/name}","comments_url":"https://api.github.com/repos/idno/Known/issues/1059/comments","events_url":"https://api.github.com/repos/idno/Known/issues/1059/events","html_url":"https://github.com/idno/Known/issues/1059","id":107417832,"number":1059,"title":"Creating and editing slugs","user":{"login":"ssundell","id":629593,"avatar_url":"https://avatars.githubusercontent.com/u/629593?v=3","gravatar_id":"","url":"https://api.github.com/users/ssundell","html_url":"https://github.com/ssundell","followers_url":"https://api.github.com/users/ssundell/followers","following_url":"https://api.github.com/users/ssundell/following{/other_user}","gists_url":"https://api.github.com/users/ssundell/gists{/gist_id}","starred_url":"https://api.github.com/users/ssundell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssundell/subscriptions","organizations_url":"https://api.github.com/users/ssundell/orgs","repos_url":"https://api.github.com/users/ssundell/repos","events_url":"https://api.github.com/users/ssundell/events{/privacy}","received_events_url":"https://api.github.com/users/ssundell/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-20T21:08:05Z","updated_at":"2016-01-29T06:50:02Z","closed_at":"2016-01-29T06:50:02Z","body":"Hi.\r\n\r\nI've been testing a Known installation for a few days, and decided to import my Blogger data into Known database. Everything went fine apart from one thing: out of 140 posts, 60 had an URL that ended with \"untitled-XXX\".\r\n\r\nAfter digging it a little bit, it seems that at least on my environment, `mb_strtolower` used in `Entity->prepare_slug` ended up doing some kind of a double encoding with incoming accented characters, which then resulted in unaccepted bytes in the input string for the following functions and the whole thing falling back to *untitled*.\r\n\r\nThis seems to be caused by a fail in detecting the internal encoding (I haven't yet checked what the application/PHP thinks the incoming string is), I just quick-fixed it by adding *UTF-8* as the character encoding for `mb_strtolower`.\r\n\r\nGoing forward, though, that only partly fixes the problem, since slug preparation just harshly removes non-ASCII characters. At best this results in unpronouncable URLs, but it may also result with confusion or, in some cases, another untitled post.\r\n\r\nSo, how about normalizing the accented characters into ASCII? Changing ä to a and ö to o is pretty standard practice for us Scandinavians, and there are tools to do that in PHP. Unfortunately it seems `iconv` transliteration depends on locale of the machine and may result with question marks. StackExchange suggests using Patchwork\\UTF8 which does the transliteration properly. It would be very nice to get something like that for creating slugs.\r\n\r\n... or at least default slugs. It would be even better if it was possible to edit the slug when creating a new post (or even better, also after posting, but it seems to be used stored in multiple places).\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26822546-creating-and-editing-slugs?utm_campaign=plugin&utm_content=tracker%2F300028&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F300028&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"}}