Bug 115330

Summary: A tab in a string causes the split(' ') method to miss some split points
Product: [Applications] konqueror Reporter: Reinhold Kainhofer <reinhold>
Component: kjsAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Sample file to show the bug (some split points are missed, and the tabs are not correctly removed from the result)

Description Reinhold Kainhofer 2005-10-29 18:10:18 UTC
Version:            (using KDE KDE 3.4.2)
Installed from:    Debian testing/unstable Packages

I have a tab-delimited javascript string which I want to split into its parts by split('	') (that's a single tab character between the quotes). However, the split method in Konqueror misses several tabs. 

Example:
The string to be split contains a tab between every word:

<script language='javascript'>
<!--
var myString='Is	this	string	split	correctly	?	Check	it	out	yourself	';
var mySplitString=myString.split('	');
document.write('<p>Split at:</p><p>'+mySplitString.join('|')+'</p>');


The result in Konqueror is:
Is| this string split correctly| ?| Check it|out yourself|

Notice that there (1) several tabs are missed and the string not split there and (2) at most places where the string is split, the tab is not correctly removed as the split should do it.


The correct result (in firefox and opera) would be:
Is|this|string|split|correctly|?|Check|it|out|yourself|


I'm attaching a sample file to quickly check this bug in the future.

Cheers,
Reinhold
Comment 1 Reinhold Kainhofer 2005-10-29 18:11:05 UTC
Created attachment 13209 [details]
Sample file to show the bug (some split points are missed, and the tabs are not correctly removed from the result)
Comment 2 George Staikos 2005-10-29 18:34:15 UTC
Will explain in other report.

*** This bug has been marked as a duplicate of 115325 ***