BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000686 [uClibc] Internationalization / Localization minor always 02-06-06 00:40 09-29-08 06:18
Reporter rfelker View Status public  
Assigned To uClibc
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0000686: utf-8 mbrtowc incorrectly returns -2 in some cases
Description According to ISO C and POSIX, (size_t)-2 is returned:

If the next n bytes contribute to an incomplete but potentially valid character, and all n bytes have been processed (no value is stored).

uClibc's mbrtowc will return -2 when given input such as [0xc0] (1 byte) or [0xed 0xa0] (2 bytes), even though these are NOT potentially valid, i.e. not initial subsequences of a valid UTF-8 sequence. This behavior complicates a calling program's logic for detecting where an encoding error occurred when attempting to resync, and probably causes scanf to behave in a noncompliant way when using the %ls, %lc, or %l[ specifiers (consuming more bytes than it should).
Additional Information
Attached Files

- Relationships

- Notes
(0012364)
carmelo73
09-29-08 02:03

Fix has been committed in rev 23549 to correclty handle oxc0 and oxc1 invalid sequence.
Anyway the multibytes sequence 0xed 0xa0 is correctly handled as incomplete, so -2 is the correct return value.
 

- Issue History
Date Modified Username Field Change
02-06-06 00:40 rfelker New Issue
02-06-06 00:40 rfelker Status new => assigned
02-06-06 00:40 rfelker Assigned To  => uClibc
02-18-06 11:50 vapier Category Standards Compliance => Internationalization / Localization
09-29-08 02:03 carmelo73 Status assigned => resolved
09-29-08 02:03 carmelo73 Fixed in Version  => 0.9.29
09-29-08 02:03 carmelo73 Resolution open => fixed
09-29-08 02:03 carmelo73 Note Added: 0012364
09-29-08 06:18 bernhardf Status resolved => closed
09-29-08 06:18 bernhardf Fixed in Version 0.9.29 => 0.9.30


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker