Bug 165368 - iconv doesn't completely clean up converter state when converting from UTF-16
Summary: iconv doesn't completely clean up converter state when converting from UTF-16
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
(Show other bugs)
Version: rawhide
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-08-08 16:44 UTC by Matthias Clasen
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-08-08 17:51:51 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
a testcase (1.54 KB, text/x-csrc)
2005-08-08 16:44 UTC, Matthias Clasen
no flags Details

Description Matthias Clasen 2005-08-08 16:44:28 UTC
It does not forget a seen BOM, therefore, you cannot reuse a UTF-16 -> UTF-8
converter for converting chunks of UTF-16 of different endianness, even if they
both start with a BOM.

The attached testcase demonstrates this.

Comment 1 Matthias Clasen 2005-08-08 16:44:28 UTC
Created attachment 117544 [details]
a testcase

Comment 2 Ulrich Drepper 2005-08-08 17:51:51 UTC
This is not a bug.  Flushing using iconv() only resets the shift state.  This is
needed for stateful encodings with states where the caller wants a converted
string to end in the initial state.  The BOM recognition has nothing to do with
shift states.  Once the byte order is determined this is a property which stays
with the iconv_t descriptor for its lifetime.


Note You need to log in before you can comment on or make changes to this bug.