# HG changeset patch # User John W. Eaton # Date 1559739864 0 # Node ID 961b76f59fa2be8e52ea7865e8bcd8e388175ee0 # Parent 61226b7bd6b9f3ab43f34596ecac3774c30f28e4# Parent 8a07083c8cfc9044aa3f2b55290fd1dcbce14c38 maint: Merge stable to default. diff -r 61226b7bd6b9 -r 961b76f59fa2 doc/interpreter/contributors.in --- a/doc/interpreter/contributors.in Tue Jun 04 20:04:21 2019 +0000 +++ b/doc/interpreter/contributors.in Wed Jun 05 13:04:24 2019 +0000 @@ -374,6 +374,7 @@ Quentin H. Spencer Christoph Spiel David Spies +Imad-Eddine Srairi Andreas Stahel Richard Stallman Russell Standish diff -r 61226b7bd6b9 -r 961b76f59fa2 libinterp/corefcn/ft-text-renderer.cc --- a/libinterp/corefcn/ft-text-renderer.cc Tue Jun 04 20:04:21 2019 +0000 +++ b/libinterp/corefcn/ft-text-renderer.cc Wed Jun 05 13:04:24 2019 +0000 @@ -914,6 +914,13 @@ // Retrieve the length and the u32 representation of the current // character int mblen = octave_u8_strmbtouc_wrapper (&u32_c, c + icurr); + if (mblen < 1) + { + // This is not an UTF-8 character, use a replacement character + mblen = 1; + u32_c = 0xFFFD; + } + n -= mblen; if (m_do_strlist && mode == MODE_RENDER) diff -r 61226b7bd6b9 -r 961b76f59fa2 libinterp/corefcn/gl2ps-print.cc --- a/libinterp/corefcn/gl2ps-print.cc Tue Jun 04 20:04:21 2019 +0000 +++ b/libinterp/corefcn/gl2ps-print.cc Wed Jun 05 13:04:24 2019 +0000 @@ -929,9 +929,10 @@ { int mblen = octave_u8_strmblen_wrapper (c + i); + // Replace multibyte or non ascii characters by a question mark if (mblen > 1) { - str += " "; + str += "?"; if (! warned) { warning_with_id ("Octave:print:unsupported-multibyte", @@ -941,6 +942,19 @@ warned = true; } } + else if (mblen < 1) + { + mblen = 1; + str += "?"; + if (! warned) + { + warning_with_id ("Octave:print:unhandled-character", + "print: only ASCII characters are " + "supported for EPS and derived " + "formats."); + warned = true; + } + } else str += tmpstr.at (i);