TADS Bug Database

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000247TADS 3Interpreterpublic2017-12-28 14:032017-12-28 14:03
Reporterfundin 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformIntelOSWindowsOS VersionVista
Summary0000247: String.splice() has trouble removing non-ASCII characters
DescriptionThe code below should produce an output of "4 4 4 4 4", but instead we see "4 4 5 4 4". The five comes from removing the "ï" in "naïve". This character would be two bytes long in UTF-8, and I suppose only one is being accounted for when recalculating the length of the string. It actually looks fine when printed, but checking with the debugger reveals an extra zero byte at the end, as in "nave\x00".
Steps To ReproduceThe following code (with an appropriate #charset directive) should illustrate the problem:

main(args)
{
    local str = 'naïve';

    for (local idx in 1..str.length)
        "<<str.splice(idx, 1).length>>\n";
}
TagsNo tags attached.
Fixed In Version
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2017-12-28 14:03 fundin New Issue


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker