code-google-com / pyv8

Automatically exported from code.google.com/p/pyv8
0 stars 0 forks source link

can't pass string that includes null-character to v8 correctly. #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

import PyV8

class Global(PyV8.JSClass):
  def echo(self, msg):
    print repr(msg)

ctxt = PyV8.JSContext(Global())
ctxt.enter()
func = ctxt.eval('(function(msg){echo(msg)})')

string_with_null_char = "hello \0 world"
func(string_with_null_char)

What is the expected output? What do you see instead?

expected: 'hello \x00 world'
instead: 'hello '

What version of the product are you using? On what operating system?

Python 2.6.5, PyV8 r273, v8 r5415, Ubuntu 10.04.1 LTS

Please provide any additional information below.

at line 719 in Wrapper.cpp, giving PyString_GET_SIZE(obj.ptr()) as a second 
argument of v8::String::New may fix this.

Original issue reported on code.google.com by menewe...@gmail.com on 7 Sep 2010 at 4:10

GoogleCodeExporter commented 9 years ago
Please verify the issue with SVN trunk after r274, thanks for your patch :)

Original comment by flier...@gmail.com on 9 Sep 2010 at 6:04

GoogleCodeExporter commented 9 years ago
verified. thanks!

Original comment by menewe...@gmail.com on 10 Sep 2010 at 6:28

GoogleCodeExporter commented 9 years ago
thanks :)

Original comment by flier...@gmail.com on 11 Sep 2010 at 3:17