From b40e60db39f0b187774cfd2e0fe1b503f9bf1a54 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 29 Jul 2010 10:57:01 +0200 Subject: Fixing http_encode(): BitlBee now calls setlocale() (for nickname transliteration to work), which changes the behaviour of isalpha() (turns out it's not a simple macro). For HTTP-encoding, this sucks, especially when doing OAuth (which is very picky about the way HTTP encoding is done). This should fix problems some people were seeing with posting Twitter messages containing accents. --- tests/check_util.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/check_util.c') diff --git a/tests/check_util.c b/tests/check_util.c index b00d645b..c323241e 100644 --- a/tests/check_util.c +++ b/tests/check_util.c @@ -160,6 +160,14 @@ START_TEST(test_word_wrap) } END_TEST +START_TEST(test_http_encode) + char s[80]; + + strcpy( s, "ee\xc3""\xab""ee!!..." ); + http_encode( s ); + fail_unless( strcmp( s, "ee%C3%ABee%21%21..." ) == 0 ); +END_TEST + Suite *util_suite (void) { Suite *s = suite_create("Util"); @@ -173,5 +181,6 @@ Suite *util_suite (void) tcase_add_test (tc_core, test_set_url_username); tcase_add_test (tc_core, test_set_url_username_pwd); tcase_add_test (tc_core, test_word_wrap); + tcase_add_test (tc_core, test_http_encode); return s; } -- cgit v1.2.3