jupyter notebook with R cannot display specific Kanji (multibyte characters)











up vote
1
down vote

favorite












I am using jupyter notebook, but R kernel(IRkernel) sometimes die when inputting Kanji(japanese multibyte chars).

I've tried a few Kanji, and found that IRkernel dies when using specific Kanji characters. For example, '十', '能', '表', etc.
enter image description here

Above image is R concole. Below is Python console.

It doesen't work with R kernel only.
enter image description here

  



[I 12:44:58.387 LabApp] Kernel started: 9bbe39ea-ef5a-40c3-ae71-fa071874fc79
-- Attaching packages --------------------------------------- tidyverse 1.2.1 --
tibble 1.4.2 purrr 0.2.5
tidyr 0.8.2 dplyr 0.7.8
readr 1.1.1 forcats 0.3.0
-- Conflicts ------------------------------------------ tidyverse_conflicts() --
x dplyr::between() masks data.table::between()
x readr::col_factor() masks scales::col_factor()
x purrr::discard() masks scales::discard()
x dplyr::first() masks data.table::first()
x dplyr::last() masks data.table::last()
x purrr::transpose() masks data.table::transpose()
[I 12:45:00.626 LabApp] Adapting to protocol v5.0 for kernel 9bbe39ea-ef5a-40c3-ae71-fa071874fc79
[E 12:45:09.377 LabApp] Uncaught exception in ZMQStream callback
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 432, in _run_callback
callback(*args, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
return fn(*args, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelskernelmanager.py", line 376, in record_activity
msg = session.deserialize(fed_msg_list)
File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
message['content'] = self.unpack(msg_list[4])
File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
json_unpacker = lambda s: jsonapi.loads(s)
File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
return jsonmod.loads(s, **kwargs)
File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)
[E 12:45:09.377 LabApp] Uncaught exception in zmqstream callback
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 450, in _handle_events
self._handle_recv()
File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 480, in _handle_recv
self._run_callback(callback, msg)
File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 432, in _run_callback
callback(*args, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
return fn(*args, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelskernelmanager.py", line 376, in record_activity
msg = session.deserialize(fed_msg_list)
File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
message['content'] = self.unpack(msg_list[4])
File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
json_unpacker = lambda s: jsonapi.loads(s)
File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
return jsonmod.loads(s, **kwargs)
File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)
Exception in callback BaseAsyncIOLoop._handle_events(1596, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(1596, 1)>
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libasyncioevents.py", line 145, in _run
self._callback(*self._args)
File "C:ProgramDataAnaconda3libsite-packagestornadoplatformasyncio.py", line 117, in _handle_events
handler_func(fileobj, events)
File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
return fn(*args, **kwargs)
File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 450, in _handle_events
self._handle_recv()
File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 480, in _handle_recv
self._run_callback(callback, msg)
File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 432, in _run_callback
callback(*args, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
return fn(*args, **kwargs)
File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelskernelmanager.py", line 376, in record_activity
msg = session.deserialize(fed_msg_list)
File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
message['content'] = self.unpack(msg_list[4])
File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
json_unpacker = lambda s: jsonapi.loads(s)
File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
return jsonmod.loads(s, **kwargs)
File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)
[E 12:45:09.377 LabApp] Uncaught exception GET /api/kernels/9bbe39ea-ef5a-40c3-ae71-fa071874fc79/channels?session_id=89b50480637cb8ce56024a508a3e4c34 (::1)
HTTPServerRequest(protocol='http', host='localhost:9999', method='GET', uri='/api/kernels/9bbe39ea-ef5a-40c3-ae71-fa071874fc79/channels?session_id=89b50480637cb8ce56024a508a3e4c34', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "C:ProgramDataAnaconda3libsite-packagestornadoweb.py", line 1499, in _stack_context_handle_exception
raise_exc_info((type, value, traceback))
File "<string>", line 4, in raise_exc_info
File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 315, in wrapped
ret = fn(*args, **kwargs)
File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 196, in <lambda>
self.on_recv(lambda msg: callback(self, msg), copy=copy)
File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelshandlers.py", line 313, in _on_zmq_reply
msg = self.session.deserialize(fed_msg_list)
File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
message['content'] = self.unpack(msg_list[4])
File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
json_unpacker = lambda s: jsonapi.loads(s)
File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
return jsonmod.loads(s, **kwargs)
File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)


And this code works on native R environment fine, so I think this is IRkernel problem.

Thanks.



*Version

OS:Win 10

jupyter-lab:0.32.1

IRkernel:'0.8.14.9000'










share|improve this question




























    up vote
    1
    down vote

    favorite












    I am using jupyter notebook, but R kernel(IRkernel) sometimes die when inputting Kanji(japanese multibyte chars).

    I've tried a few Kanji, and found that IRkernel dies when using specific Kanji characters. For example, '十', '能', '表', etc.
    enter image description here

    Above image is R concole. Below is Python console.

    It doesen't work with R kernel only.
    enter image description here

      



    [I 12:44:58.387 LabApp] Kernel started: 9bbe39ea-ef5a-40c3-ae71-fa071874fc79
    -- Attaching packages --------------------------------------- tidyverse 1.2.1 --
    tibble 1.4.2 purrr 0.2.5
    tidyr 0.8.2 dplyr 0.7.8
    readr 1.1.1 forcats 0.3.0
    -- Conflicts ------------------------------------------ tidyverse_conflicts() --
    x dplyr::between() masks data.table::between()
    x readr::col_factor() masks scales::col_factor()
    x purrr::discard() masks scales::discard()
    x dplyr::first() masks data.table::first()
    x dplyr::last() masks data.table::last()
    x purrr::transpose() masks data.table::transpose()
    [I 12:45:00.626 LabApp] Adapting to protocol v5.0 for kernel 9bbe39ea-ef5a-40c3-ae71-fa071874fc79
    [E 12:45:09.377 LabApp] Uncaught exception in ZMQStream callback
    Traceback (most recent call last):
    File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
    File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
    File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelskernelmanager.py", line 376, in record_activity
    msg = session.deserialize(fed_msg_list)
    File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
    message['content'] = self.unpack(msg_list[4])
    File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
    json_unpacker = lambda s: jsonapi.loads(s)
    File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
    return jsonmod.loads(s, **kwargs)
    File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
    return _default_decoder.decode(s)
    File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)
    [E 12:45:09.377 LabApp] Uncaught exception in zmqstream callback
    Traceback (most recent call last):
    File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 450, in _handle_events
    self._handle_recv()
    File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
    File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
    File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
    File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelskernelmanager.py", line 376, in record_activity
    msg = session.deserialize(fed_msg_list)
    File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
    message['content'] = self.unpack(msg_list[4])
    File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
    json_unpacker = lambda s: jsonapi.loads(s)
    File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
    return jsonmod.loads(s, **kwargs)
    File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
    return _default_decoder.decode(s)
    File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)
    Exception in callback BaseAsyncIOLoop._handle_events(1596, 1)
    handle: <Handle BaseAsyncIOLoop._handle_events(1596, 1)>
    Traceback (most recent call last):
    File "C:ProgramDataAnaconda3libasyncioevents.py", line 145, in _run
    self._callback(*self._args)
    File "C:ProgramDataAnaconda3libsite-packagestornadoplatformasyncio.py", line 117, in _handle_events
    handler_func(fileobj, events)
    File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
    File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 450, in _handle_events
    self._handle_recv()
    File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
    File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
    File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
    File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelskernelmanager.py", line 376, in record_activity
    msg = session.deserialize(fed_msg_list)
    File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
    message['content'] = self.unpack(msg_list[4])
    File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
    json_unpacker = lambda s: jsonapi.loads(s)
    File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
    return jsonmod.loads(s, **kwargs)
    File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
    return _default_decoder.decode(s)
    File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)
    [E 12:45:09.377 LabApp] Uncaught exception GET /api/kernels/9bbe39ea-ef5a-40c3-ae71-fa071874fc79/channels?session_id=89b50480637cb8ce56024a508a3e4c34 (::1)
    HTTPServerRequest(protocol='http', host='localhost:9999', method='GET', uri='/api/kernels/9bbe39ea-ef5a-40c3-ae71-fa071874fc79/channels?session_id=89b50480637cb8ce56024a508a3e4c34', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
    File "C:ProgramDataAnaconda3libsite-packagestornadoweb.py", line 1499, in _stack_context_handle_exception
    raise_exc_info((type, value, traceback))
    File "<string>", line 4, in raise_exc_info
    File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
    File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
    File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelshandlers.py", line 313, in _on_zmq_reply
    msg = self.session.deserialize(fed_msg_list)
    File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
    message['content'] = self.unpack(msg_list[4])
    File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
    json_unpacker = lambda s: jsonapi.loads(s)
    File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
    return jsonmod.loads(s, **kwargs)
    File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
    return _default_decoder.decode(s)
    File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)


    And this code works on native R environment fine, so I think this is IRkernel problem.

    Thanks.



    *Version

    OS:Win 10

    jupyter-lab:0.32.1

    IRkernel:'0.8.14.9000'










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I am using jupyter notebook, but R kernel(IRkernel) sometimes die when inputting Kanji(japanese multibyte chars).

      I've tried a few Kanji, and found that IRkernel dies when using specific Kanji characters. For example, '十', '能', '表', etc.
      enter image description here

      Above image is R concole. Below is Python console.

      It doesen't work with R kernel only.
      enter image description here

        



      [I 12:44:58.387 LabApp] Kernel started: 9bbe39ea-ef5a-40c3-ae71-fa071874fc79
      -- Attaching packages --------------------------------------- tidyverse 1.2.1 --
      tibble 1.4.2 purrr 0.2.5
      tidyr 0.8.2 dplyr 0.7.8
      readr 1.1.1 forcats 0.3.0
      -- Conflicts ------------------------------------------ tidyverse_conflicts() --
      x dplyr::between() masks data.table::between()
      x readr::col_factor() masks scales::col_factor()
      x purrr::discard() masks scales::discard()
      x dplyr::first() masks data.table::first()
      x dplyr::last() masks data.table::last()
      x purrr::transpose() masks data.table::transpose()
      [I 12:45:00.626 LabApp] Adapting to protocol v5.0 for kernel 9bbe39ea-ef5a-40c3-ae71-fa071874fc79
      [E 12:45:09.377 LabApp] Uncaught exception in ZMQStream callback
      Traceback (most recent call last):
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 432, in _run_callback
      callback(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
      return fn(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelskernelmanager.py", line 376, in record_activity
      msg = session.deserialize(fed_msg_list)
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
      message['content'] = self.unpack(msg_list[4])
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
      json_unpacker = lambda s: jsonapi.loads(s)
      File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
      return jsonmod.loads(s, **kwargs)
      File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
      return _default_decoder.decode(s)
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
      obj, end = self.scan_once(s, idx)
      json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)
      [E 12:45:09.377 LabApp] Uncaught exception in zmqstream callback
      Traceback (most recent call last):
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 450, in _handle_events
      self._handle_recv()
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 480, in _handle_recv
      self._run_callback(callback, msg)
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 432, in _run_callback
      callback(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
      return fn(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelskernelmanager.py", line 376, in record_activity
      msg = session.deserialize(fed_msg_list)
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
      message['content'] = self.unpack(msg_list[4])
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
      json_unpacker = lambda s: jsonapi.loads(s)
      File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
      return jsonmod.loads(s, **kwargs)
      File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
      return _default_decoder.decode(s)
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
      obj, end = self.scan_once(s, idx)
      json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)
      Exception in callback BaseAsyncIOLoop._handle_events(1596, 1)
      handle: <Handle BaseAsyncIOLoop._handle_events(1596, 1)>
      Traceback (most recent call last):
      File "C:ProgramDataAnaconda3libasyncioevents.py", line 145, in _run
      self._callback(*self._args)
      File "C:ProgramDataAnaconda3libsite-packagestornadoplatformasyncio.py", line 117, in _handle_events
      handler_func(fileobj, events)
      File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
      return fn(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 450, in _handle_events
      self._handle_recv()
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 480, in _handle_recv
      self._run_callback(callback, msg)
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 432, in _run_callback
      callback(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
      return fn(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelskernelmanager.py", line 376, in record_activity
      msg = session.deserialize(fed_msg_list)
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
      message['content'] = self.unpack(msg_list[4])
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
      json_unpacker = lambda s: jsonapi.loads(s)
      File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
      return jsonmod.loads(s, **kwargs)
      File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
      return _default_decoder.decode(s)
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
      obj, end = self.scan_once(s, idx)
      json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)
      [E 12:45:09.377 LabApp] Uncaught exception GET /api/kernels/9bbe39ea-ef5a-40c3-ae71-fa071874fc79/channels?session_id=89b50480637cb8ce56024a508a3e4c34 (::1)
      HTTPServerRequest(protocol='http', host='localhost:9999', method='GET', uri='/api/kernels/9bbe39ea-ef5a-40c3-ae71-fa071874fc79/channels?session_id=89b50480637cb8ce56024a508a3e4c34', version='HTTP/1.1', remote_ip='::1')
      Traceback (most recent call last):
      File "C:ProgramDataAnaconda3libsite-packagestornadoweb.py", line 1499, in _stack_context_handle_exception
      raise_exc_info((type, value, traceback))
      File "<string>", line 4, in raise_exc_info
      File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 315, in wrapped
      ret = fn(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 196, in <lambda>
      self.on_recv(lambda msg: callback(self, msg), copy=copy)
      File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelshandlers.py", line 313, in _on_zmq_reply
      msg = self.session.deserialize(fed_msg_list)
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
      message['content'] = self.unpack(msg_list[4])
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
      json_unpacker = lambda s: jsonapi.loads(s)
      File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
      return jsonmod.loads(s, **kwargs)
      File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
      return _default_decoder.decode(s)
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
      obj, end = self.scan_once(s, idx)
      json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)


      And this code works on native R environment fine, so I think this is IRkernel problem.

      Thanks.



      *Version

      OS:Win 10

      jupyter-lab:0.32.1

      IRkernel:'0.8.14.9000'










      share|improve this question















      I am using jupyter notebook, but R kernel(IRkernel) sometimes die when inputting Kanji(japanese multibyte chars).

      I've tried a few Kanji, and found that IRkernel dies when using specific Kanji characters. For example, '十', '能', '表', etc.
      enter image description here

      Above image is R concole. Below is Python console.

      It doesen't work with R kernel only.
      enter image description here

        



      [I 12:44:58.387 LabApp] Kernel started: 9bbe39ea-ef5a-40c3-ae71-fa071874fc79
      -- Attaching packages --------------------------------------- tidyverse 1.2.1 --
      tibble 1.4.2 purrr 0.2.5
      tidyr 0.8.2 dplyr 0.7.8
      readr 1.1.1 forcats 0.3.0
      -- Conflicts ------------------------------------------ tidyverse_conflicts() --
      x dplyr::between() masks data.table::between()
      x readr::col_factor() masks scales::col_factor()
      x purrr::discard() masks scales::discard()
      x dplyr::first() masks data.table::first()
      x dplyr::last() masks data.table::last()
      x purrr::transpose() masks data.table::transpose()
      [I 12:45:00.626 LabApp] Adapting to protocol v5.0 for kernel 9bbe39ea-ef5a-40c3-ae71-fa071874fc79
      [E 12:45:09.377 LabApp] Uncaught exception in ZMQStream callback
      Traceback (most recent call last):
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 432, in _run_callback
      callback(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
      return fn(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelskernelmanager.py", line 376, in record_activity
      msg = session.deserialize(fed_msg_list)
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
      message['content'] = self.unpack(msg_list[4])
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
      json_unpacker = lambda s: jsonapi.loads(s)
      File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
      return jsonmod.loads(s, **kwargs)
      File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
      return _default_decoder.decode(s)
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
      obj, end = self.scan_once(s, idx)
      json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)
      [E 12:45:09.377 LabApp] Uncaught exception in zmqstream callback
      Traceback (most recent call last):
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 450, in _handle_events
      self._handle_recv()
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 480, in _handle_recv
      self._run_callback(callback, msg)
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 432, in _run_callback
      callback(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
      return fn(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelskernelmanager.py", line 376, in record_activity
      msg = session.deserialize(fed_msg_list)
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
      message['content'] = self.unpack(msg_list[4])
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
      json_unpacker = lambda s: jsonapi.loads(s)
      File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
      return jsonmod.loads(s, **kwargs)
      File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
      return _default_decoder.decode(s)
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
      obj, end = self.scan_once(s, idx)
      json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)
      Exception in callback BaseAsyncIOLoop._handle_events(1596, 1)
      handle: <Handle BaseAsyncIOLoop._handle_events(1596, 1)>
      Traceback (most recent call last):
      File "C:ProgramDataAnaconda3libasyncioevents.py", line 145, in _run
      self._callback(*self._args)
      File "C:ProgramDataAnaconda3libsite-packagestornadoplatformasyncio.py", line 117, in _handle_events
      handler_func(fileobj, events)
      File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
      return fn(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 450, in _handle_events
      self._handle_recv()
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 480, in _handle_recv
      self._run_callback(callback, msg)
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 432, in _run_callback
      callback(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 276, in null_wrapper
      return fn(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelskernelmanager.py", line 376, in record_activity
      msg = session.deserialize(fed_msg_list)
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
      message['content'] = self.unpack(msg_list[4])
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
      json_unpacker = lambda s: jsonapi.loads(s)
      File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
      return jsonmod.loads(s, **kwargs)
      File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
      return _default_decoder.decode(s)
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
      obj, end = self.scan_once(s, idx)
      json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)
      [E 12:45:09.377 LabApp] Uncaught exception GET /api/kernels/9bbe39ea-ef5a-40c3-ae71-fa071874fc79/channels?session_id=89b50480637cb8ce56024a508a3e4c34 (::1)
      HTTPServerRequest(protocol='http', host='localhost:9999', method='GET', uri='/api/kernels/9bbe39ea-ef5a-40c3-ae71-fa071874fc79/channels?session_id=89b50480637cb8ce56024a508a3e4c34', version='HTTP/1.1', remote_ip='::1')
      Traceback (most recent call last):
      File "C:ProgramDataAnaconda3libsite-packagestornadoweb.py", line 1499, in _stack_context_handle_exception
      raise_exc_info((type, value, traceback))
      File "<string>", line 4, in raise_exc_info
      File "C:ProgramDataAnaconda3libsite-packagestornadostack_context.py", line 315, in wrapped
      ret = fn(*args, **kwargs)
      File "C:ProgramDataAnaconda3libsite-packageszmqeventloopzmqstream.py", line 196, in <lambda>
      self.on_recv(lambda msg: callback(self, msg), copy=copy)
      File "C:ProgramDataAnaconda3libsite-packagesnotebookserviceskernelshandlers.py", line 313, in _on_zmq_reply
      msg = self.session.deserialize(fed_msg_list)
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 933, in deserialize
      message['content'] = self.unpack(msg_list[4])
      File "C:ProgramDataAnaconda3libsite-packagesjupyter_clientsession.py", line 105, in <lambda>
      json_unpacker = lambda s: jsonapi.loads(s)
      File "C:ProgramDataAnaconda3libsite-packageszmqutilsjsonapi.py", line 56, in loads
      return jsonmod.loads(s, **kwargs)
      File "C:ProgramDataAnaconda3libjson__init__.py", line 354, in loads
      return _default_decoder.decode(s)
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 339, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "C:ProgramDataAnaconda3libjsondecoder.py", line 355, in raw_decode
      obj, end = self.scan_once(s, idx)
      json.decoder.JSONDecodeError: Invalid escape: line 1 column 25 (char 24)


      And this code works on native R environment fine, so I think this is IRkernel problem.

      Thanks.



      *Version

      OS:Win 10

      jupyter-lab:0.32.1

      IRkernel:'0.8.14.9000'







      python r jupyter-notebook jupyter-irkernel






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 22 at 3:55

























      asked Nov 22 at 3:40









      dkan

      62




      62





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423555%2fjupyter-notebook-with-r-cannot-display-specific-kanji-multibyte-characters%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423555%2fjupyter-notebook-with-r-cannot-display-specific-kanji-multibyte-characters%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          What visual should I use to simply compare current year value vs last year in Power BI desktop

          Alexandru Averescu

          Trompette piccolo