Author ysj.ray
Recipients eric.smith, ezio.melotti, lemburg, mark.dickinson, ron_adam, vstinner, ysj.ray
Date 2011-02-18.15:02:35
SpamBayes Score 9.21749e-07
Marked as misclassified No
Message-id <1298041357.84.0.352337402226.issue7330@psf.upfronthosting.co.za>
In-reply-to
Content
> No you don't. You can copy a substring of the input string with
Py_UNICODE_COPY: just pass a smaller length.

Oh, yes, I got your meaning now. I'll follow this.


> You can truncate the input char* on the call to PyUnicode_DecodeUTF8:

Oh, what if the trunked char* cannot be decoded correctly? e.g. a tow-bytes character is divided in the middle? 


> Yes, but I am no more sure that it is the right thing to do.

If I understand correctly(my English ability is limited), your suggestion is to combine, right? I'm afraid that combine may bring us too complicated code to write. The currently 4 steps just divide the process into smaller and simpler pieces. I'm not sure.
History
Date User Action Args
2011-02-18 15:02:37ysj.raysetrecipients: + ysj.ray, lemburg, mark.dickinson, vstinner, eric.smith, ron_adam, ezio.melotti
2011-02-18 15:02:37ysj.raysetmessageid: <1298041357.84.0.352337402226.issue7330@psf.upfronthosting.co.za>
2011-02-18 15:02:35ysj.raylinkissue7330 messages
2011-02-18 15:02:35ysj.raycreate