Skip to content

UTF-8 support - repl/editor panicking #161

Description

@zenria

Hi, there are a couple of issue with current utf-8 support eg. When in repl or in editor, I type:

print "é"

When I type the last double quote, endbasic panics:

philou@siderant ~ $ RUST_BACKTRACE=1 endbasic --console=graphics                                                                                                     101 [11:19:57]
thread 'main' panicked at 'byte index 8 is not a char boundary; it is inside 'é' (bytes 7..9) of `print "é`', /Users/philou/.cargo/registry/src/github.com-1ecc6299db9ec823/endbasic-std-0.8.1/src/console/readline.rs:179:39
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.rs:116:14
   2: core::str::slice_error_fail
   3: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   5: tokio::park::thread::CachedParkThread::block_on
   6: tokio::runtime::thread_pool::ThreadPool::block_on
   7: tokio::runtime::Runtime::block_on
   8: endbasic::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

This also happens if I type é and then backspace. With a similar error:

thread 'main' panicked at 'byte index 1 is not a char boundary; it is inside 'é' (bytes 0..2) of `é`', /Users/philou/.cargo/registry/src/github.com-1ecc6299db9ec823/endbasic-std-0.8.1/src/console/readline.rs:144:39

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions