let category_of_string str =
match str with
"LC_CTYPE" -> LC_CTYPE
| "LC_NUMERIC" -> LC_NUMERIC
| "LC_TIME" -> LC_TIME
| "LC_COLLATE" -> LC_COLLATE
| "LC_MONETARY" -> LC_MONETARY
| "LC_MESSAGES" -> LC_MESSAGES
| "LC_ALL" -> LC_ALL
| _ -> raise (Invalid_argument "category_of_string")