Am Sonntag, 14. Oktober 2007 05:10 schrieb [EMAIL PROTECTED]:

>  InsetHyperlink::InsetHyperlink(InsetCommandParams const & p)
> @@ -58,14 +65,61 @@
>  int InsetHyperlink::latex(Buffer const &, odocstream & os,
>                   OutputParams const & runparams) const
>  {
> -     docstring const & name = getParam("name");
> +     string url = to_utf8(getParam("target"));

This is wrong. String processing must not be done with utf8 encoded 
strings. It can fail in many ways, for example url.length() may not be 
equal to the number of characters.
If you do any string processing, do it with docstrings, this is safe.

Besides, this is a file format change and needs lyx2lyx support. For 
example, a previously escaped "\%" needs to be changed to an 
unescaped "%".
I saw your comment that Richard would do some (other?) lyx2lyx stuff, but 
not long ago there was a rule that no file format change was allowed to go 
in without lyx2lyx in the same patch. If this rule has been dropped it was 
a very bad idea IMHO.

Finally, the code looks very ad hoc, and I would almost bet that it 
contains a bug. Why don't you use the existing, bug free escaping code 
that is used for normal text?


Georg

Reply via email to