{"comment":{"created_at":"2011-10-11T13:52:01Z","body":"According to the man page of setlocale and also this FAQ:\r\n\r\nhttp://www.cl.cam.ac.uk/~mgk25/unicode.html#activate\r\n\r\n... it would be sufficient to set the locale for the category LC_CTYPE, instead of LC_ALL.\r\n\r\nSo did you mean something like the following?\r\n\r\n    char * szCurrentLocale = setlocale(LC_CTYPE, NULL);\r\n    if (szCurrentLocale) {\r\n        setlocale(LC_CTYPE, szCurrentLocale);\r\n    } else {\r\n        setlocale(LC_CTYPE, \"\");\r\n    }\r\n\r\n\r\nI've just replaced your original `setlocale(LC_ALL,\"\");` by the above and it seems to work now: libhid doesn't change the locale that has been set by my application.","updated_at":"2011-10-11T13:52:01Z","url":"https://api.github.com/repos/signal11/hidapi/issues/comments/2361525","id":2361525,"user":{"avatar_url":"https://secure.gravatar.com/avatar/228b346d4175a5d55b091fcae8ad038d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/axeloide","id":119622,"login":"axeloide"}},"action":"created","issue":{"number":25,"created_at":"2011-10-11T12:44:12Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"\r\nThe calls to `setlocale(LC_ALL,\"\");` in functions `hid_enumerate()` and `hid_open_path()` seem to be the cause for my application to forget about the locale it sets on start-up.\r\n\r\nWhat is the rationale behind those calls? Could it be done in a way that doesn't interfere with the application's locale setting?","comments":2,"title":"Interference with application's locale.","updated_at":"2011-10-11T13:52:01Z","url":"https://api.github.com/repos/signal11/hidapi/issues/25","id":1874259,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/228b346d4175a5d55b091fcae8ad038d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/axeloide","id":119622,"login":"axeloide"},"html_url":"https://github.com/signal11/hidapi/issues/25","labels":[],"state":"open"},"legacy":{"issue_id":1874259,"comment_id":2361525}}