Improve the documentation on pre-flighting for u_strFromUTF8

Description

I discovered by trial and error that preflighting (`buffer==NULL, capacity=0`) the conversion from UTF8 to UChar* will still report a "buffer overflow error", which must then be ignored after preflighting.

This is not documented in the function API. And while the documentation is technically correct, it is not obvious that when an error code is set that the buffer destination length is also set correctly. Which may lead to some user confusion.

To illustrate, I lost a few hours yesterday debugging why the buffer overflow happens during preflight, only to realize that this is WAI. I don't think this should be something that silently comes out of the constraints, but should be documented explicitly.

Status

Assignee

Markus Scherer

Reporter

Filip Filmar

Labels

None

Reviewer

None

Time Needed

Hours

Start date

None

Components

Fix versions

Priority

minor