Quantcast

[HtmlUnit] [htmlunit:bugs] #1722 javascript.tools.SourceReader only skips the UTF-16BE BOM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] [htmlunit:bugs] #1722 javascript.tools.SourceReader only skips the UTF-16BE BOM

Sam Smoot

[bugs:#1722] javascript.tools.SourceReader only skips the UTF-16BE BOM

Status: open
Group: 2.18
Created: Tue Sep 29, 2015 10:31 PM UTC by Sam Smoot
Last Updated: Tue Sep 29, 2015 10:31 PM UTC
Owner: nobody

I'm trying to getPage for a page that references a Javascript source with a UTF-8 BOM.

The correct encoding is being used, but SourceReader only skips the BOM for UTF-16BE sources so I get a ScriptException: illegal character.

See: http://grepcode.com/file/repo1.maven.org/maven2/net.sourceforge.htmlunit/htmlunit-core-js/2.17/net/sourceforge/htmlunit/corejs/javascript/tools/SourceReader.java?av=f#123

The UTF-16BE BOM is hard-coded. That's only going to work for one of the five UTF encodings supported by the if() statement just above it.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------

_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] [htmlunit:bugs] #1722 javascript.tools.SourceReader only skips the UTF-16BE BOM

Ahmed Ashour-3

Hi, can you provide a test case?


[bugs:#1722] javascript.tools.SourceReader only skips the UTF-16BE BOM

Status: open
Group: 2.18
Created: Tue Sep 29, 2015 10:31 PM UTC by Sam Smoot
Last Updated: Tue Sep 29, 2015 10:31 PM UTC
Owner: nobody

I'm trying to getPage for a page that references a Javascript source with a UTF-8 BOM.

The correct encoding is being used, but SourceReader only skips the BOM for UTF-16BE sources so I get a ScriptException: illegal character.

See: http://grepcode.com/file/repo1.maven.org/maven2/net.sourceforge.htmlunit/htmlunit-core-js/2.17/net/sourceforge/htmlunit/corejs/javascript/tools/SourceReader.java?av=f#123

The UTF-16BE BOM is hard-coded. That's only going to work for one of the five UTF encodings supported by the if() statement just above it.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------

_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] [htmlunit:bugs] #1722 javascript.tools.SourceReader only skips the UTF-16BE BOM

Ahmed Ashour-3
In reply to this post by Sam Smoot
  • status: open --> pending

[bugs:#1722] javascript.tools.SourceReader only skips the UTF-16BE BOM

Status: pending
Group: 2.18
Created: Tue Sep 29, 2015 10:31 PM UTC by Sam Smoot
Last Updated: Tue Sep 29, 2015 10:41 PM UTC
Owner: nobody

I'm trying to getPage for a page that references a Javascript source with a UTF-8 BOM.

The correct encoding is being used, but SourceReader only skips the BOM for UTF-16BE sources so I get a ScriptException: illegal character.

See: http://grepcode.com/file/repo1.maven.org/maven2/net.sourceforge.htmlunit/htmlunit-core-js/2.17/net/sourceforge/htmlunit/corejs/javascript/tools/SourceReader.java?av=f#123

The UTF-16BE BOM is hard-coded. That's only going to work for one of the five UTF encodings supported by the if() statement just above it.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------

_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] [htmlunit:bugs] #1722 javascript.tools.SourceReader only skips the UTF-16BE BOM

RBRi-2
In reply to this post by Sam Smoot

Better late than never.
Have done some updates on encoding detection. Hope this will fix your problems.
Please open a new issue if you still facing this problem.


[bugs:#1722] javascript.tools.SourceReader only skips the UTF-16BE BOM

Status: pending
Group: 2.18
Created: Tue Sep 29, 2015 10:31 PM UTC by Sam Smoot
Last Updated: Mon Nov 02, 2015 09:34 AM UTC
Owner: nobody

I'm trying to getPage for a page that references a Javascript source with a UTF-8 BOM.

The correct encoding is being used, but SourceReader only skips the BOM for UTF-16BE sources so I get a ScriptException: illegal character.

See: http://grepcode.com/file/repo1.maven.org/maven2/net.sourceforge.htmlunit/htmlunit-core-js/2.17/net/sourceforge/htmlunit/corejs/javascript/tools/SourceReader.java?av=f#123

The UTF-16BE BOM is hard-coded. That's only going to work for one of the five UTF encodings supported by the if() statement just above it.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] [htmlunit:bugs] #1722 javascript.tools.SourceReader only skips the UTF-16BE BOM

RBRi-2
In reply to this post by Sam Smoot
  • status: pending --> closed
  • assigned_to: RBRi

[bugs:#1722] javascript.tools.SourceReader only skips the UTF-16BE BOM

Status: closed
Group: 2.18
Created: Tue Sep 29, 2015 10:31 PM UTC by Sam Smoot
Last Updated: Sun May 14, 2017 04:34 PM UTC
Owner: RBRi

I'm trying to getPage for a page that references a Javascript source with a UTF-8 BOM.

The correct encoding is being used, but SourceReader only skips the BOM for UTF-16BE sources so I get a ScriptException: illegal character.

See: http://grepcode.com/file/repo1.maven.org/maven2/net.sourceforge.htmlunit/htmlunit-core-js/2.17/net/sourceforge/htmlunit/corejs/javascript/tools/SourceReader.java?av=f#123

The UTF-16BE BOM is hard-coded. That's only going to work for one of the five UTF encodings supported by the if() statement just above it.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Loading...