Comments (8)
Could you assign it to me? This is my first try of open source and I'm very interested in this task. Thanks.
from incubator-fury.
hmm, this is a bug, UTF-8 is barely used in meta string. Acutally, most chars are ascii chars. So it's not covered in Fury serialization tests. We need to fix it and add some unit tests.
Thanks for pointing out this bug @qingoba
from incubator-fury.
Great, thanks for the willingness to contribute to Fury
from incubator-fury.
In function public MetaString encode(String input, Encoding encoding)
in file MetaStringEncoder.java
, there is a section of code:
default:
byte[] bytes = input.getBytes(StandardCharsets.UTF_8);
return new MetaString(
input, Encoding.UTF_8, specialChar1, specialChar2, bytes, bytes.length * 8, 0);
why the numBits
is 0
, rather bytes.length * 8
?
why the numChars
is bytes.length * 8
, rather bytes.length
?
from incubator-fury.
I have a new idea, we can add a bit to incidate whether strip last char in encoded meta string if the encoding is not UTF-8. In this way, we don't have to store num bits and num chars in MetaString
from incubator-fury.
Exactly.
Because 5 + 5 > 8
, in the last byte, there is at most one empty character.
Suppose we use empty
to mark whether last char is empty, then the actual number of characters is equal to len(bytes) * 8 / 5 - empty
from incubator-fury.
In this way, the Decoder does not need to accept numBits
arguments.
from incubator-fury.
I have a new idea, we can add a bit to incidate whether strip last char in encoded meta string if the encoding is not UTF-8. In this way, we don't have to store num bits and num chars in MetaString
Hi @qingoba , I added stip last char flag to spec in #1565 . I believe this will make the implementation simpler
from incubator-fury.
Related Issues (20)
- [Java] Support userContext for user custom global data HOT 2
- [Upgrade to Fury 0.5] class org.apache.fury.serializer.UnexistedClassSerializers$UnexistedSkipClass cannot be cast to class HOT 1
- No type mapping from class java.lang.String to class java.lang.String
- [All] Clear serialization language flag HOT 4
- Upgrade dubbo-serialization-fury fury-core dependency to 0.5.0 HOT 2
- In asyncCompilation to true, under the condition of it. The "it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap" serialization failure HOT 2
- [Java|Go] Check string is ascii before using meta string encoding HOT 6
- feat(java): Enumerating new values, deserializing without any new enumerations, resulting in the array being out of bounds and unable to parse properly
- [Java] Serialization error for java inner class HOT 1
- JSONObject Enum key searializer fail java.lang.ClassCastException: HOT 2
- Multi Thread Serialize/Deserialize benchmark issue 多线程下序列化性能异常
- [java] FuryPooledObjectFactory#classLoaderFuryPooledCache remove softValues HOT 10
- NullPointerException when serializing a custom type HOT 11
- Concerning license in the javadoc jar HOT 2
- it's a bit troublesome to install on apple systems. error: externally-managed-environment...... HOT 2
- [java] jit code of collection with abstract class deserialize error HOT 4
- Enum equality does not work across serialization-deserialization HOT 5
- Mac install using “conda install -c conda-forge pyarrow” command is completed, how to set pyarrow of environment variables?
- [Doc] Use a script to update documentation when code is modified
- [Rust] Please publish fury for rust to crates.io
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from incubator-fury.