{"action":"created","issue":{"url":"https://api.github.com/repos/apple/cups/issues/4899","repository_url":"https://api.github.com/repos/apple/cups","labels_url":"https://api.github.com/repos/apple/cups/issues/4899/labels{/name}","comments_url":"https://api.github.com/repos/apple/cups/issues/4899/comments","events_url":"https://api.github.com/repos/apple/cups/issues/4899/events","html_url":"https://github.com/apple/cups/issues/4899","id":182322779,"number":4899,"title":"still problems with cups-lpd mini-daemon and non unicode characters ","user":{"login":"BIT-SERV-OS","id":22774368,"avatar_url":"https://avatars.githubusercontent.com/u/22774368?v=3","gravatar_id":"","url":"https://api.github.com/users/BIT-SERV-OS","html_url":"https://github.com/BIT-SERV-OS","followers_url":"https://api.github.com/users/BIT-SERV-OS/followers","following_url":"https://api.github.com/users/BIT-SERV-OS/following{/other_user}","gists_url":"https://api.github.com/users/BIT-SERV-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/BIT-SERV-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BIT-SERV-OS/subscriptions","organizations_url":"https://api.github.com/users/BIT-SERV-OS/orgs","repos_url":"https://api.github.com/users/BIT-SERV-OS/repos","events_url":"https://api.github.com/users/BIT-SERV-OS/events{/privacy}","received_events_url":"https://api.github.com/users/BIT-SERV-OS/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-11T17:18:54Z","updated_at":"2016-10-13T13:23:07Z","closed_at":null,"body":"Dear all, \r\n\r\ni just rpmbuild 2.2.1 on CENTOS 7.2.1511 and hoped  to avoid utf-8 problems as i found  \r\n\r\n'smart_strlcpy()' - Copy a string and convert from ISO-8859-1 to UTF-8 as needed.\r\nin the  source of cups-lpd.\r\n\r\nBut this implementation does not appear to work for me. I still get errors like this one:\r\n\r\nCreate-Job client-error-attributes-or-values-not-supported: Bad job-name value: \\\"job-name\\\": Bad name value \\\"CAT<C1>LOGO MAY 2016 [Modo de Compatibilidade].pdf\\\" - bad UTF-8 sequence (RFC 2911 section 4.1.2).\r\n\r\nWhen some prints from a windows server are spooled to cups-lpr that contains special characters.\r\n\r\nMay it be that the match does not find all foreign chars or replaces them wrong?\r\n\r\nKind Regards\r\nOlaf\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apple/cups/issues/comments/253511471","html_url":"https://github.com/apple/cups/issues/4899#issuecomment-253511471","issue_url":"https://api.github.com/repos/apple/cups/issues/4899","id":253511471,"user":{"login":"JTeichmann","id":22816690,"avatar_url":"https://avatars.githubusercontent.com/u/22816690?v=3","gravatar_id":"","url":"https://api.github.com/users/JTeichmann","html_url":"https://github.com/JTeichmann","followers_url":"https://api.github.com/users/JTeichmann/followers","following_url":"https://api.github.com/users/JTeichmann/following{/other_user}","gists_url":"https://api.github.com/users/JTeichmann/gists{/gist_id}","starred_url":"https://api.github.com/users/JTeichmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JTeichmann/subscriptions","organizations_url":"https://api.github.com/users/JTeichmann/orgs","repos_url":"https://api.github.com/users/JTeichmann/repos","events_url":"https://api.github.com/users/JTeichmann/events{/privacy}","received_events_url":"https://api.github.com/users/JTeichmann/received_events","type":"User","site_admin":false},"created_at":"2016-10-13T13:23:07Z","updated_at":"2016-10-13T13:23:07Z","body":"I found the problem in the function 'smart_strlcpy()' in the 'scheduler/cups-lpd.c'.\r\nUTF-8 has to look binary like this four possibilities:\r\n0xxxxxxx\r\n110xxxxx 10xxxxxx\r\n1110xxxx 10xxxxxx 10xxxxxx\r\n11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\r\n\r\nIf it's possibility 2 to 4 only byte one is checked. Byte two, three and four not. For these bytes there has to be proofed something like this:\r\nif ((*srcptr & 0xc0) == 0x80)\t\t/*is second byte starting with 10 (utf-8 has two)*/\r\n    *dstptr++ = *srcptr++;\r\nelse\r\n    *dstptr++ = (*srcptr++ >> 2) | 0x80;\r\n\r\nI will try it tomorrow and test if the function then works correctly."}}
{"actor":{"display_login":"JTeichmann"}}