Re: [enlarge-users] 2 bugs
Status: Alpha
Brought to you by:
asual
From: Rostislav H. <ros...@gm...> - 2006-04-11 19:47:39
|
Hi, can you please let me know if the following code works for you? String bom =3D ""; int chars =3D 0; byte[] bytes =3D fileContent.getBytes(); if ((bytes[0] =3D=3D (byte) 0xEF) && (bytes[1] =3D=3D (byte) 0xBB) && (bytes[2] =3D=3D (byte) 0xBF)) { =09chars =3D 3; } else if ((bytes[0] =3D=3D (byte) 0xFE) && (bytes[1] =3D=3D (byte) 0xFF)) = { =09chars =3D 1; } else if ((bytes[0] =3D=3D (byte) 0xFF) && (bytes[1] =3D=3D (byte) 0xFE)) = { =09chars =3D 1; } else if ((bytes[0] =3D=3D (byte) 0x00) && (bytes[1] =3D=3D (byte) 0x00) &= & (bytes[2] =3D=3D (byte) 0xFE) && (bytes[3] =3D=3D (byte) 0xFF)) { =09chars =3D 1; } else if ((bytes[0] =3D=3D (byte) 0xFF) && (bytes[1] =3D=3D (byte) 0xFE) &= & (bytes[2] =3D=3D (byte) 0x00) && (bytes[3] =3D=3D (byte) 0x00)) { =09chars =3D 1; } bom =3D fileContent.substring(0, chars); fileContent =3D fileContent.substring(chars); Thanks, Rostislav On 4/11/06, KaalH! <ka...@sm...> wrote: > Le mardi 11 avril 2006 =E0 00:15 +0300, Rostislav Hristov a =E9crit : > > Hi KaalH, > > > > thank you for digging through the code. I have no experience with BOM > > and I got stucked with your fix, because it breaks my tests. Anyway I > > found the difference in the Representation table available here: > > > > http://en.wikipedia.org/wiki/Byte_Order_Mark > > > > My code detects the first BOM sequence, while yours detects the second > > one. That's why I'll include them both. > > > > Cheers, > > Rostislav > > > > > > I'm also newbie wih BOM ;) > > I've just found this interesting code sample : > http://www.tutorials.de/forum/1245315-post7.html > > kaalh > > > > > > > > > On 4/10/06, KaalH! <ka...@sm...> wrote: > > > Le lundi 10 avril 2006 =E0 15:12 +0300, Rostislav Hristov a =E9crit : > > > > Hi KaalH, > > > > > > > > a pre-release is available at http://enlarge.sf.net/enlarge-0.1.3.z= ip > > > > Let me know if any of the issues persist. > > > > > > > > Greets, > > > > Rostislav > > > > > > > Hi, > > > > > > the "UTF8 BOM" issue still persits. > > > > > > I've found a way to fix it, see the attached file. > > > > > > > > > kaalh > > > > > > > > > > > > > > > > > > > On 4/9/06, KaalH! <ka...@sm...> wrote: > > > > > Le dimanche 09 avril 2006 =E0 11:33 +0300, Rostislav Hristov a = =E9crit : > > > > > > Hi KaalH, > > > > > > > > > > > > I have implemented the interface support. Give me more info abo= ut the > > > > > > other issue and I'll preprare a new release. > > > > > > > > > > > > Rostislav > > > > > > > > > > > > > > > > great :) > > > > > > > > > > I got more on the other issue: > > > > > > > > > > using ASDT, files are created with UTF8 BOM as first char ( EF BB= BF ) > > > > > when running in an UTF8 env (mine is ubuntu dapper) as in the att= ached > > > > > file. > > > > > > > > > > kaalh > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > EnFlash - It's all about features... > > > > > > http://www.asual.com/enflash/ > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > > This SF.Net email is sponsored by xPML, a groundbreaking script= ing language > > > > > > that extends applications into web and mobile media. Attend the= live webcast > > > > > > and join the prime developer group breaking into this new codin= g territory! > > > > > > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&d= at=121642 > > > > > > _______________________________________________ > > > > > > enlarge-users mailing list > > > > > > enl...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/enlarge-users > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > EnFlash - It's all about features... > > > > http://www.asual.com/enflash/ > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.Net email is sponsored by xPML, a groundbreaking scripting = language > > > > that extends applications into web and mobile media. Attend the liv= e webcast > > > > and join the prime developer group breaking into this new coding te= rritory! > > > > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&dat= =121642 > > > > _______________________________________________ > > > > enlarge-users mailing list > > > > enl...@li... > > > > https://lists.sourceforge.net/lists/listinfo/enlarge-users > > > > > > > > > > > > > > > -- > > EnFlash - It's all about features... > > http://www.asual.com/enflash/ > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by xPML, a groundbreaking scripting lang= uage > > that extends applications into web and mobile media. Attend the live we= bcast > > and join the prime developer group breaking into this new coding territ= ory! > > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&dat=12164= 2 > > _______________________________________________ > > enlarge-users mailing list > > enl...@li... > > https://lists.sourceforge.net/lists/listinfo/enlarge-users > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting langua= ge > that extends applications into web and mobile media. Attend the live webc= ast > and join the prime developer group breaking into this new coding territor= y! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > enlarge-users mailing list > enl...@li... > https://lists.sourceforge.net/lists/listinfo/enlarge-users > -- EnFlash - It's all about features... http://www.asual.com/enflash/ |