diff -up cups-1.3.7/CHANGES.txt.str3832 cups-1.3.7/CHANGES.txt diff -up cups-1.3.7/cups/transcode.c.str3832 cups-1.3.7/cups/transcode.c --- cups-1.3.7/cups/transcode.c.str3832 2008-01-16 23:42:35.000000000 +0000 +++ cups-1.3.7/cups/transcode.c 2012-01-18 13:07:00.982927934 +0000 @@ -3,7 +3,7 @@ * * Transcoding support for the Common UNIX Printing System (CUPS). * - * Copyright 2007-2008 by Apple Inc. + * Copyright 2007-2011 by Apple Inc. * Copyright 1997-2007 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -279,7 +279,7 @@ cupsCharsetToUTF8( * Handle identity conversions... */ - if (encoding == CUPS_UTF8 || + if (encoding == CUPS_UTF8 || encoding <= CUPS_US_ASCII || encoding < 0 || encoding >= CUPS_ENCODING_VBCS_END) { strlcpy((char *)dest, src, maxout); @@ -385,13 +385,14 @@ cupsUTF8ToCharset( * Handle UTF-8 to ISO-8859-1 directly... */ - if (encoding == CUPS_ISO8859_1) + if (encoding == CUPS_ISO8859_1 || encoding == CUPS_US_ASCII) { - int ch; /* Character from string */ + int ch, /* Character from string */ + maxch; /* Maximum character for charset */ char *destptr, /* Pointer into ISO-8859-1 buffer */ *destend; /* End of ISO-8859-1 buffer */ - + maxch = encoding == CUPS_ISO8859_1 ? 256 : 128; destptr = dest; destend = dest + maxout - 1; @@ -403,7 +404,7 @@ cupsUTF8ToCharset( { ch = ((ch & 0x1f) << 6) | (*src++ & 0x3f); - if (ch < 256) + if (ch < maxch) *destptr++ = ch; else *destptr++ = '?';