brianmario / charlock_holmes

Character encoding detection, brought to you by ICU
MIT License
1.04k stars 141 forks source link

U_BUFFER_OVERFLOW_ERROR and U_STRING_NOT_TERMINATED_WARNING need to be handled the same way instead of raising an error #111

Open koljaa opened 7 years ago

koljaa commented 7 years ago

http://userguide.icu-project.org/strings Regarding the following statement in the release notes the U_STRING_NOT_TERMINATED_WARNING error need to be handle the same way as U_BUFFER_OVERFLOW_ERROR. https://github.com/brianmario/charlock_holmes/blob/master/ext/charlock_holmes/converter.c#L29

"Some functions used to set an overflow error code even when only the terminating NUL did not fit into the output buffer. These functions now set UErrorCode to U_STRING_NOT_TERMINATED_WARNING rather than to U_BUFFER_OVERFLOW_ERROR."

Or is there any reason why the U_STRING_NOT_TERMINATED_WARNING should raise an error?