buglibiconv - Bugs: bug #32410, Bug report iconv_string

 
 

bug #32410: Bug report iconv_string

Submitted by:  None
Submitted on:  Thu 10 Feb 2011 09:03:22 AM UTC  
 
Category: ExamplesSeverity: 3 - Normal
Item Group: NoneStatus: Duplicate
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Closed

Discussion locked!

 

Thu 10 Feb 2011 10:53:11 AM UTC, comment #1:

This is a duplicate of https://savannah.gnu.org/bugs/?32399

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Thu 10 Feb 2011 09:03:22 AM UTC, original submission:

Hello

There is a bug in iconv_string function (version 1.13.1)
The following code reproduces the bug:

{
char pcString[] = {'t','e','s','t','é','\0'}; // In memory at &pcString in hexa there is: 74 65 73 74 e9 00 <- “testé”
size_t uiLength = strlen(pcString); // uiLength = 5
char* pcResult = 0;
iconv_string("UTF-8", "autodetect_utf8", pcString, pcString+uiLength+1, &pcResult, &uiLength);
}

Returned pcResult is wrong : "ýýýý««««««««îþîþ" (in memory: fd fd fd fd ab ab ab ab ab ab ab ab ee fe ee fe 00)

If pcString is “tésté” the result is OK : "tésté" (in memory: 74 c3 a9 73 74 c3 a9 00)

It seems that the bug occurs when the ‘é’ character is in alone in the string and in last position.

Bye

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by haible (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 23 Nov 2016 11:59:19 PM UTChaibleCategoryNone=>Examples
    Thu 10 Feb 2011 10:53:11 AM UTChaibleStatusNone=>Duplicate
      Assigned toNone=>haible
      Open/ClosedOpen=>Closed
      Discussion LockUnlocked=>Locked

    Back to the top


    Powered by Savane 3.1-cleanup1