diff --git a/Changes b/Changes index bcbc99d..bfbffaa 100644 --- a/Changes +++ b/Changes @@ -19,6 +19,8 @@ Release ... characters now. * Handle character case conversions with the '~' vi command correctly if the length of the converted multibyte sequence is smaller than the original one. +* Multibyte sequences that correspond to an unprintable character are now + printed as multiple octal escape sequences. * Fixed an old vi bug: If a vi command that yanked or deleted part of a line was followed by an ex command that also yanked or deleted some text, a following 'p' vi command pasted the text affected by the former vi command. diff --git a/ex_subr.c b/ex_subr.c index dee97e9..480bea0 100644 --- a/ex_subr.c +++ b/ex_subr.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_subr.c 1.32 (gritter) 12/2/04"; +static char sccsid[] = "@(#)ex_subr.c 1.33 (gritter) 1/12/05"; #endif #endif @@ -560,6 +560,22 @@ printof(int c) char *nums = "01234567"; int d; +#ifdef MB + if (mb_cur_max > 1 && (c & INVBIT) == 0 && c & ~0177) { + char mb[MB_LEN_MAX]; + int i, n, x = EOF; + if ((n = wctomb(mb, c & TRIM)) <= 0) { + n = 1; + *mb = 0; + } + for (i = 0; i < n; i++) { + x = printof(mb[i] | INVBIT); + if (i+1 < n) + normchar(x); + } + return x; + } +#endif /* MB */ c &= 0377; if (c < 040 || c == DELETE) { normchar('^'); diff --git a/ex_version.c b/ex_version.c index b0fd927..07e62d7 100644 --- a/ex_version.c +++ b/ex_version.c @@ -70,12 +70,12 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * Sccsid @(#)ex_version.c 1.112 (gritter) 1/11/05 + * Sccsid @(#)ex_version.c 1.113 (gritter) 1/12/05 */ #include "ex.h" -static char *versionstring = "@(#)Version 4.0 (gritter) 1/11/05"; +static char *versionstring = "@(#)Version 4.0 (gritter) 1/12/05"; void printver(void)