apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Uwe Zeisberger <zeisb...@informatik.uni-freiburg.de>
Subject [PATCH] fix apr_xlate_conv_buffer and testxlate
Date Thu, 18 Nov 2004 16:22:50 GMT

I found a testxlate in the test dir of apr-util, which is not build and
fails to correctly convert to UTF-7.

One reason is, that the trailing '\0' is translated to. An other is,
that iconv cannot convert (in some cases) a buffer completly without
knowing, that the string really ends at the end of inbuf. This only
affects encodings, where in one (encoded) byte may be information for
more then one decoded byte (i.e. UTF-7).

Below comes a log and a patch. I assume, that apr_xlate_conv_buffer
should convert inbuf and assume, that the strings ends then. Else its
use in test/testxlate.c is not appropriate.

(I'm on GNU/Linux using gcc 3.3.4 (Debian 1:3.3.4-13))

Below is the log message and an patch is attached.


BTW: you will not need the .cvsignore files, which are in the subversion
repo, any more.

Fix apr_xlate_conv_buffer when using iconv()

* xlate/xlate.c
  (apr_xlate_conv_buffer): terminate conversion correctly by adding the 
  terminal shift sequence.

* test/Makefile.in
  add a build rule for testxlate and add testxlate to PROGRAMS

* test/testxlate.c
  (test_conversion): instead of converting the trailing '\0', append a
  '\0' to the result.

Uwe Zeisberger


View raw message