Skip to content

Add option of choosing key charset, enable keys with non-ascii characters#25

Merged
spkrka merged 3 commits intomasterfrom
krka/charsets
Feb 19, 2015
Merged

Add option of choosing key charset, enable keys with non-ascii characters#25
spkrka merged 3 commits intomasterfrom
krka/charsets

Conversation

@spkrka
Copy link
Member

@spkrka spkrka commented Feb 18, 2015

No description provided.

@nresare
Copy link
Contributor

nresare commented Feb 18, 2015

I looked around a bit for a test case that actually tests non-ascii keys but failed to find it. Perhaps we should have that? (Or perhaps I'm blind)

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling ea36b41 on krka/charsets into * on master*.

@spkrka
Copy link
Member Author

spkrka commented Feb 18, 2015

Yes, that should be added before we merge this. I wanted to get some more general feedback on code architecture/design first.

@nresare
Copy link
Contributor

nresare commented Feb 18, 2015

If you just want a review of the overall thinking, I have looked through the code and it seems reasonable to me. The fact that the number of parameters is pretty high in many places doesn't matter that much in my opinion as they are at the lower levels of the code.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 4697abc on krka/charsets into * on master*.

1 similar comment
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 4697abc on krka/charsets into * on master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 4697abc on krka/charsets into * on master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 4c6a154 on krka/charsets into * on master*.

@josefalcon
Copy link

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in scope for this PR, but APIs that expose byte[] is a problem. Should we use/do something like ByteString?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, though this class is not really directly exposed to regular users of the library.

We could of course try to improve it by making it package private and move all the classes that need it into the same package. Which might make sense anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree to the second statement I presume? :)

@spkrka
Copy link
Member Author

spkrka commented Feb 19, 2015

I fixed everything except the public getKey().
Making that method (and some of the others there) not public causes a chain reaction of package changes, I think that should be a separate pull request.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 0d83e48 on krka/charsets into * on master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling cd7cd94 on krka/charsets into * on master*.

@nresare
Copy link
Contributor

nresare commented Feb 19, 2015

One idea I got reading your discussion is that perhaps it is best to just always use UTF-8. UTF-8 is backwards compatible with ASCII, doesn't encode any characters with null bytes or overlapping ascii control characters. That way the code could probably be simplified while supporting the full range of java Strings.

@spkrka
Copy link
Member Author

spkrka commented Feb 19, 2015

Perhaps there is some value in support these charsets though? http://en.wikipedia.org/wiki/ISO/IEC_8859

In any case, I don't think the code complexity is that much worse now, in fact I think some parts are slightly better (key validation and ascii decoder)

spkrka added a commit that referenced this pull request Feb 19, 2015
Add option of choosing key charset, enable keys with non-ascii characters
@spkrka spkrka merged commit 10f80c6 into master Feb 19, 2015
@spkrka spkrka deleted the krka/charsets branch February 19, 2015 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants