Hi all,

I'm building apr-util 1.5.4 and testxlate fails for me converting
from UTF-7 to UTF-8. My apr-iconv is version 1.2.1 R2.

I debugged convert_to_ucs in unicode-1-1-utf-7.c and realized the
following: The test string "Edelwei+AN8-" is processed until the only
left character in "inbuf" is "-" as the current character to process
and the last character in the string. The function ends by returning
UCS_CHAR_NONE in that case, because utf7_state[0] is true, the current
character to process is utf7_shift_out, but inbytesleft is 1 instead
of 2, because, "-" is the last char of the string already.

From my currently limited understanding of UTF-7 this case is no
error, but "-" should just be ignored. But the caller translates
UCS_CHAR_NONE into APR_EINVAL which gets translated into
APR_INCOMPLETE in the function apr_xlate_conv_buffer, which is checked
against APR_SUCCESS in the test_conversion and the test fails.

This looks like an error to me, the conversion shouldn't state that
more chars are needed, but recognize the end of the string and
terminate successfully. Of course that would mean that this test
wouldn't have ever worked, which sounds unlikely...

Any thoughts on this? Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

Reply via email to