> Or output to a string (or ostringstream) first and then use rstrip. > But it may be that this will not do encoding properly. What encoding > does hyperref want in its title things?
afaiu there is possibility to switch between PDFDocEncoding and unicode. i played a bit with setting enc. to utf8 in lyx and then tweak hyperref without success, but i'm no expert in these issues. when i looked how lyx deals with similar parts of tex output i just found things like // FIXME UNICODE lyxpreamble += "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% " "User specified LaTeX commands.\n" + from_utf8(preamble) + '\n'; so i'm actually unsure, that the code i copied, like os << "pdftitle={" << from_utf8(pdfoptions().title) ... can work for different encodings. i remember that i was even unsure that pdfoptions.title being std::string is enough. thats why asked for revision. pavel