Re: Setting the Gogo shell to UTF-8?

2022-09-16 Thread David Leangen (OSGi)
Hey, thanks Raymond.

> If I had to guess it would have to do with processing pure bytes without
> considering encoding and hence multi-byte characters.
> 
> I'd be willing to guess that's a fundamental implementation flaw
> potentially down to the telnet protocol itself.

H. In that case, sounds like I'll just have to deal with it somehow.

Based on your theory, do you have an idea about how I could potentially 
re-encode a string? Even if there is an issue with encoding, so long as 
whatever happens is not lossy, I should be able to "get back" my characters, no?

Or, any other ideas for a workaround? The only thing I can think of right now 
is writing the arguments to a file. I don't have encoding problems with file 
I/O, only when I use stdin.

Cheers,
=David


Setting the Gogo shell to UTF-8?

2022-09-15 Thread David Leangen (OSGi)
Hi!

I am having trouble using UTF-8 characters with the Gogo Shell.

I have implemented a command “register” that takes a string argument. I try to 
run it like this:

g! register 何か漢字で書いてる言葉

The string gets parsed as "何か漢字で書いてる言葉” instead of 
“何か漢字で書いてる言葉”. Not even sure what encoding that is.

I checked the stack trace in debug mode to ensure it wasn’t my code. It seems 
to me that from the moment the text is input into the shell it gets interpreted 
that way (all the way up the stack trace).

I tried echo as well:


```
g! echo こんにちは
こんにちは
```


I already checked out a few threads and tried those fixes, but no luck:

 * 
https://stackoverflow.com/questions/361975/setting-the-default-java-character-encoding/623036
 * 
https://stackoverflow.com/questions/8920712/osgi-bundle-doesnt-display-utf-8-characters


I updated my gogo shell to the latest available version on Maven Central.


Any other ideas about how I could resolve this issue?


Thanks!
=David



-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org