New topic: Zero width non-breaking space on reading data?
<http://forums.realsoftware.com/viewtopic.php?t=29367> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message Carl Adler Post subject: Zero width non-breaking space on reading data?Posted: Mon Aug 03, 2009 1:46 pm Joined: Thu Apr 05, 2007 11:35 am Posts: 68 In trying to solve a problem with reading text in a XML file with endofline characters I came across the following unrelated(?) peculiarity. Using RealBasic 2009 v2.1 and the code: Dim f as FolderItem dim t as TextInputStream dim ss,s,s2 as string f=GetFolderItem("testit.txt") If f <> Nil then t=f.openastextfile ss=t.ReadAll ss=ReplaceLineEndings(ss,endofline) s="one two three" s2="four five six" editfield1.text=s //EditField1.text=EditField1.text+endofline+s2 EditField1.text=EditField1.text+endofline+ss end if //end code "testit.txt is a UTF8 textfile with the text four five six Running the code as shown I get in EditField1.txt one two three four five six Commenting out the last line (ends with ss) and using the line above it I get seemingly the same result. But in the first case if I copy the text in the editfield to BBEdit I find an invisible character preceding the line starting with four. BBEdit identifies it has having the code \0xFEFF I guess FEFF is Hex for 65279 which is identified in one place as a zero width non-breaking character. If true I guess it is not a real problem. However, it still does not seem like it should be there. Does anyone have an insight into this? Carl Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
