Re: [enlarge-users] 2 bugs
Status: Alpha
Brought to you by:
asual
From: KaalH! <ka...@sm...> - 2006-04-12 05:33:40
|
Le mardi 11 avril 2006 à 22:47 +0300, Rostislav Hristov a écrit : > Hi, > > can you please let me know if the following code works for you? it doesn't work. > String bom = ""; > int chars = 0; > byte[] bytes = fileContent.getBytes(); > > if ((bytes[0] == (byte) 0xEF) && (bytes[1] == (byte) 0xBB) && > (bytes[2] == (byte) 0xBF)) { > chars = 3; works with "chars = 1" here > } else if ((bytes[0] == (byte) 0xFE) && (bytes[1] == (byte) 0xFF)) { > chars = 1; > } else if ((bytes[0] == (byte) 0xFF) && (bytes[1] == (byte) 0xFE)) { > chars = 1; > } else if ((bytes[0] == (byte) 0x00) && (bytes[1] == (byte) 0x00) && > (bytes[2] == (byte) 0xFE) && (bytes[3] == (byte) 0xFF)) { > chars = 1; > } else if ((bytes[0] == (byte) 0xFF) && (bytes[1] == (byte) 0xFE) && > (bytes[2] == (byte) 0x00) && (bytes[3] == (byte) 0x00)) { > chars = 1; > } > > bom = fileContent.substring(0, chars); > fileContent = fileContent.substring(chars); > > > Thanks, > Rostislav > > > > On 4/11/06, KaalH! <ka...@sm...> wrote: > > Le mardi 11 avril 2006 à 00:15 +0300, Rostislav Hristov a écrit : > > > 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 à 15:12 +0300, Rostislav Hristov a écrit : > > > > > Hi KaalH, > > > > > > > > > > a pre-release is available at http://enlarge.sf.net/enlarge-0.1.3.zip > > > > > 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 à 11:33 +0300, Rostislav Hristov a écrit : > > > > > > > Hi KaalH, > > > > > > > > > > > > > > I have implemented the interface support. Give me more info about 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 attached > > > > > > file. > > > > > > > > > > > > kaalh > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > 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 live webcast > > > > > > > and join the prime developer group breaking into this new coding territory! > > > > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 > > > > > > > _______________________________________________ > > > > > > > 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 live webcast > > > > > and join the prime developer group breaking into this new coding territory! > > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 > > > > > _______________________________________________ > > > > > 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 live webcast > > > and join the prime developer group breaking into this new coding territory! > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 > > > _______________________________________________ > > > 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 language > > that extends applications into web and mobile media. Attend the live webcast > > and join the prime developer group breaking into this new coding territory! > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&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 language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 > _______________________________________________ > enlarge-users mailing list > enl...@li... > https://lists.sourceforge.net/lists/listinfo/enlarge-users |