mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 11:06:50 +01:00
- [SF 2513643] Seg fault in Poco::UTF8::toLower on 64-bit Linux
- removed support for 5- and 6-byte sequences - fixed error counting in StreamConverterBuf::readFromDevice() - added std::dec to poco_stdout_dbg and poco_stderr_dbg macros
This commit is contained in:
@@ -129,7 +129,7 @@ protected:
|
||||
|
||||
#if defined(_DEBUG)
|
||||
# define poco_stdout_dbg(outstr) \
|
||||
std::cout << __FILE__ << '(' << __LINE__ << "):" << outstr << std::endl;
|
||||
std::cout << __FILE__ << '(' << std::dec << __LINE__ << "):" << outstr << std::endl;
|
||||
#else
|
||||
# define poco_stdout_dbg(outstr)
|
||||
#endif
|
||||
@@ -137,7 +137,7 @@ protected:
|
||||
|
||||
#if defined(_DEBUG)
|
||||
# define poco_stderr_dbg(outstr) \
|
||||
std::cerr << __FILE__ << '(' << __LINE__ << "):" << outstr << std::endl;
|
||||
std::cerr << __FILE__ << '(' << std::dec << __LINE__ << "):" << outstr << std::endl;
|
||||
#else
|
||||
# define poco_stderr_dbg(outstr)
|
||||
#endif
|
||||
|
||||
@@ -59,6 +59,16 @@ public:
|
||||
int convert(const unsigned char* bytes) const;
|
||||
int convert(int ch, unsigned char* bytes, int length) const;
|
||||
|
||||
static bool isLegal(const unsigned char *bytes, int length);
|
||||
/// Utility routine to tell whether a sequence of bytes is legal UTF-8.
|
||||
/// This must be called with the length pre-determined by the first byte.
|
||||
/// The sequence is illegal right away if there aren't enough bytes
|
||||
/// available. If presented with a length > 4, this function returns false.
|
||||
/// The Unicode definition of UTF-8 goes up to 4-byte sequences.
|
||||
///
|
||||
/// Adapted from ftp://ftp.unicode.org/Public/PROGRAMS/CVTUTF/ConvertUTF.c
|
||||
/// Copyright 2001-2004 Unicode, Inc.
|
||||
|
||||
private:
|
||||
static const char* _names[];
|
||||
static const CharacterMap _charMap;
|
||||
|
||||
Reference in New Issue
Block a user