Add String.bytes + Character.bytes and possibly change Character constructor
See original GitHub issue[@gavinking] We need to add bytes
attributes to String
and Character
to get the UTF-8 encoding. We should also consider the problem of going in the other direction, Byte[]
->Character
/String
, perhaps changing the constructor of Character
to accept Byte[0]|Byte[2]|Byte[4]
.
[Migrated from ceylon/ceylon.language#519]
Issue Analytics
- State:
- Created 9 years ago
- Comments:13 (1 by maintainers)
Top Results From Across the Web
How to convert Strings to and from UTF8 byte arrays in Java
You can convert directly via the String(byte[], String) constructor and getBytes(String) method. Java exposes available character sets via the Charset class ...
Read more >Byte Encodings and Strings (The Java™ Tutorials ...
Byte Encodings and Strings. If a byte array contains non-Unicode text, you can convert the text to Unicode with one of the String...
Read more >4.5 Byte Strings - Racket Documentation
A byte string can be mutable or immutable. When an immutable byte string is provided to a procedure like bytes-set!, the exn:fail:contract exception...
Read more >How to use character encoding classes in .NET - Microsoft Learn
NET encoding classes provide a way to store and convert character data. ... The following example uses a single byte array to encode...
Read more >Strings - Julia Documentation
This allows for efficient indexing into strings by the byte index of an encoded representation rather than by a character index, which cannot...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve considered this issue several times, and always concluded it’s probably not a good idea. Closing.
[@gavinking] Not for 1.1, since it seems there is no consensus on whether it would be a good thing.