--- aplplot.cc.orig 2014-09-24 19:49:49.506390550 +0200 +++ aplplot.cc 2014-09-26 16:34:40.130609125 +0200 @@ -84,6 +84,7 @@ static string xlabel; static string ylabel; static string tlabel; +static string plwindow = "APLplot"; static bool xlog = false; static bool ylog = false; static int mode = APL_MODE_XY; @@ -117,6 +118,7 @@ xlabel.clear (); ylabel.clear (); tlabel.clear (); + plwindow = "APLplot"; xlog = false; ylog = false; mode = APL_MODE_XY; @@ -557,6 +559,9 @@ { plspage (0.0, 0.0, plot_width, plot_height, 0.0, 0.0); plscolbg (bgred, bggreen, bgblue); + + plsetopt("plwindow", plwindow.c_str()); + plinit (); int axis_val = (mode == APL_MODE_XY) @@ -946,7 +951,30 @@ if (A->is_char_string()) { //const ShapeItem count = A->element_count(); const UCS_string ustr = A->get_UCS_ravel(); // unicode - const UTF8_string utf (ustr); + UTF8_string utf (ustr); + + // the option parser below seems not to like UTF8 encoded option values. + // we want UTF8 in the window caption and extract it here... + // + { + const char * plwin = strstr(utf.c_str(), "plwindow"); + if (plwin) + { + const int chars_before_plwin = plwin - utf.c_str(); + plwin += 8; // skip "plwindow " + if (*plwin) ++plwin; + plwindow.clear(); + while (*plwin) + { + if (*plwin == ';') { ++plwin; break; } + else plwindow += *plwin++; + } + + utf.shrink(chars_before_plwin); + while (*plwin) utf.append(*plwin++); + } + } + const string sstr ((const char *)(utf.get_items()), utf.size()); //const Rank rank = A->get_rank();