diff options
author | Roger Leigh <rleigh@debian.org> | 2006-06-28 21:56:35 +0000 |
---|---|---|
committer | Roger Leigh <rleigh@debian.org> | 2006-06-28 21:56:35 +0000 |
commit | 40050e1152d6767f59a37272f077ce473b544319 (patch) | |
tree | fdbc604f7a1560752ced615dedcdea6393d8eec1 | |
parent | d184abf9a17453fd599ed3eab834a8b87ed5326f (diff) | |
download | schroot-40050e1152d6767f59a37272f077ce473b544319.tar.gz |
* TODO: Remove completed item.
* sbuild/sbuild-util.cc (narrow_string, widen_string): Throw a
runtime_error on conversion failure.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | TODO | 9 | ||||
-rw-r--r-- | sbuild/sbuild-util.cc | 5 |
3 files changed, 12 insertions, 9 deletions
@@ -1,5 +1,12 @@ 2006-06-28 Roger Leigh <rleigh@debian.org> + * TODO: Remove completed item. + + * sbuild/sbuild-util.cc (narrow_string, widen_string): Throw a + runtime_error on conversion failure. + +2006-06-28 Roger Leigh <rleigh@debian.org> + * sbuild/sbuild-auth.cc: Fix switched authentication and authorisation messages. @@ -17,15 +17,6 @@ PENDING the boost::format markup changes fixing first. What are other projects doing? -* Handle charset conversion errors more gracefully. - - sbuild-util widen_string and narrow_string. Currently an error - occurs if in a C locale the string contains non-US-ASCII characters - or, in other locales if the gettext message catalogue has bad - strings. The string is truncated to the point of error, or may be - empty depending where the error is. We should error out a bit - better in this case. Assertion, or exception? - * Use boost::format markup in the standard error strings. This will complete the i18n support for error translation. It will diff --git a/sbuild/sbuild-util.cc b/sbuild/sbuild-util.cc index a6b1ab20..4c1daf9e 100644 --- a/sbuild/sbuild-util.cc +++ b/sbuild/sbuild-util.cc @@ -19,6 +19,7 @@ #include <config.h> +#include "sbuild-error.h" #include "sbuild-util.h" #include <sys/types.h> @@ -206,6 +207,8 @@ sbuild::widen_string (std::string const& str, } else if (res == std::codecvt_base::error) { + throw runtime_error + ("A character set conversion failed. Please report this bug."); break; } else @@ -251,6 +254,8 @@ sbuild::narrow_string (std::wstring const& str, } else if (res == std::codecvt_base::error) { + throw runtime_error + ("A character set conversion failed. Please report this bug."); break; } else |