{"action":"created","issue":{"url":"https://api.github.com/repos/JetBrains/Exposed/issues/433","repository_url":"https://api.github.com/repos/JetBrains/Exposed","labels_url":"https://api.github.com/repos/JetBrains/Exposed/issues/433/labels{/name}","comments_url":"https://api.github.com/repos/JetBrains/Exposed/issues/433/comments","events_url":"https://api.github.com/repos/JetBrains/Exposed/issues/433/events","html_url":"https://github.com/JetBrains/Exposed/issues/433","id":381949581,"node_id":"MDU6SXNzdWUzODE5NDk1ODE=","number":433,"title":"Problem with cyrillic encoding","user":{"login":"GrishinSergey","id":12826416,"node_id":"MDQ6VXNlcjEyODI2NDE2","avatar_url":"https://avatars1.githubusercontent.com/u/12826416?v=4","gravatar_id":"","url":"https://api.github.com/users/GrishinSergey","html_url":"https://github.com/GrishinSergey","followers_url":"https://api.github.com/users/GrishinSergey/followers","following_url":"https://api.github.com/users/GrishinSergey/following{/other_user}","gists_url":"https://api.github.com/users/GrishinSergey/gists{/gist_id}","starred_url":"https://api.github.com/users/GrishinSergey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrishinSergey/subscriptions","organizations_url":"https://api.github.com/users/GrishinSergey/orgs","repos_url":"https://api.github.com/users/GrishinSergey/repos","events_url":"https://api.github.com/users/GrishinSergey/events{/privacy}","received_events_url":"https://api.github.com/users/GrishinSergey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-18T11:01:03Z","updated_at":"2018-11-19T08:50:58Z","closed_at":null,"author_association":"NONE","body":"Hello, \r\nI tryed to fix a problem with encodings. So, I sent from 'Postman', from web browser request to server, where I search data in database by keys in request. Request can be like this:\r\n`http://localhost:8080/books.getBooksByGenre/Документальное/0/10` (in browser). Server receive string, like \r\n`http://localhost:8080/books.getBooksByGenre/%D0%94%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D0%B5/0/10`,\r\ntake params from it:\r\ngenreName: Документальное\r\nstart: 0\r\ncount: 10.\r\nThen, this data sends to dao:\r\n```kotlin\r\noverride fun findGenreByName(genreName: String): DatabaseGenre {\r\n    return transaction(db) { getGenreByName(genreName) }\r\n}\r\n\r\nprivate fun getGenreByName(genreName: String): DatabaseGenre {\r\n    return try {\r\n        val foundGenre = GenreEntity.find { Genres.genre eq genreName }.single()\r\n        DatabaseGenre(foundGenre.id.value, foundGenre.genre, foundGenre.link)\r\n    } catch (e: Exception) {\r\n        throw NothingFoundInDatabaseException(\"no one genre found by '$genreName'\")\r\n    } catch (e: NoSuchElementException) {\r\n        val m = \"Duplicates of genre with name '$genreName'\"\r\n        throw DuplicatedDataInDatabaseException(m)\r\n    }\r\n}\r\n```\r\n\r\nIn log I see, that sql-query for finding genres is correct, but I receive an exception:\r\n```\r\njava.util.NoSuchElementException: Collection is empty.\r\n```\r\n\r\nThe sql-query, as I said, is correct:\r\n```sql\r\nSELECT genres.id, genres.genre, genres.link FROM genres WHERE genres.genre = 'Документальное'\r\n```\r\n\r\nStructure of genres table:\r\n```\r\ngenres\r\n  id: int(10)\r\n  genre: varchar(100)\r\n  link: varchar(100\r\n```\r\n\r\n\r\nI tryied, to select all genres, and this query executed almost correctly. So, I decided, to check this query with english word, and this query correctly executed:\r\n```sql\r\nSELECT genres.id, genres.genre, genres.link FROM genres WHERE genres.genre = 'simpleGenre'\r\n```\r\nI have not exceptions with this query.\r\n\r\nSo, what I've done wrong and how to fix problem with collations?\r\n\r\nP.S.: link to question on stackowerflow: https://stackoverflow.com/questions/53360110/exposed-kotlin-problem-with-cyrillic-encoding"},"comment":{"url":"https://api.github.com/repos/JetBrains/Exposed/issues/comments/439815374","html_url":"https://github.com/JetBrains/Exposed/issues/433#issuecomment-439815374","issue_url":"https://api.github.com/repos/JetBrains/Exposed/issues/433","id":439815374,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTgxNTM3NA==","user":{"login":"Tapac","id":194469,"node_id":"MDQ6VXNlcjE5NDQ2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/194469?v=4","gravatar_id":"","url":"https://api.github.com/users/Tapac","html_url":"https://github.com/Tapac","followers_url":"https://api.github.com/users/Tapac/followers","following_url":"https://api.github.com/users/Tapac/following{/other_user}","gists_url":"https://api.github.com/users/Tapac/gists{/gist_id}","starred_url":"https://api.github.com/users/Tapac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tapac/subscriptions","organizations_url":"https://api.github.com/users/Tapac/orgs","repos_url":"https://api.github.com/users/Tapac/repos","events_url":"https://api.github.com/users/Tapac/events{/privacy}","received_events_url":"https://api.github.com/users/Tapac/received_events","type":"User","site_admin":false},"created_at":"2018-11-19T08:50:58Z","updated_at":"2018-11-19T08:50:58Z","author_association":"CONTRIBUTOR","body":"If you replace `{ Genres.genre eq genreName }` with `{ Genres.genre eq \"Документальное\" }` will the result be the same?"}}
{"actor":{"display_login":"Tapac"}}