/** * Copyright (c) 2009-2010 Mika Laitio * * This library is covered by the LGPL version 3, read LICENSE for details. * * History: * - Created libcharencoding_test.c on: Nov 25, 2009 */ #include #include #include "charencoding.h" char *get_input_encoded_to_utf8() { char *text; char *ret_val; int err_flg; printf("enter text: "); text = readline(""); ret_val = utf8_encode(text, &err_flg); return ret_val; } int main(void) { char *utf8s; printf("is_utf8_locale: %d\n", is_utf8_locale()); utf8s = get_input_encoded_to_utf8(); utf8_printf("%s\n", utf8s); return 0; }