Skip to content

Conversation

@kjnilsson
Copy link
Contributor

No description provided.

@kjnilsson kjnilsson marked this pull request as ready for review December 15, 2022 11:27
@kjnilsson kjnilsson requested a review from ansd December 15, 2022 16:32
% convert to binary for faster operations later
% mostly in segment_from_index_file/1
evaluate_retention(list_to_binary(Dir), Specs);
evaluate_retention(unicode:characters_to_binary(Dir), Specs);
Copy link
Member

Choose a reason for hiding this comment

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

You always convert to unicode = utf8 even if the VM is running in latin1 mode. I think it's probably fine here. Just want to add a note that
https://github.com/erlang/otp/blob/a1f235fc05653fa524fc7c4a352398af6ce0b364/lib/stdlib/src/filename.erl#L845-L851 uses file:native_name_encoding() as OutEncoding.

@ansd
Copy link
Member

ansd commented Dec 16, 2022

list_to_binary(Name).

I assume we don't support Unicode in the stream name, correct?

Changes make sense to me.
With this branch I also cannot see anymore any formatter crashes that I used to see with the stream test included in rabbitmq/rabbitmq-server#6684

@kjnilsson
Copy link
Contributor Author

list_to_binary(Name).

I assume we don't support Unicode in the stream name, correct?
Changes make sense to me. With this branch I also cannot see anymore any formatter crashes that I used to see with the stream test included in rabbitmq/rabbitmq-server#6684

all stream names only contain base64uri compatible characters so this should be fine here.

@kjnilsson kjnilsson merged commit 399b470 into main Dec 16, 2022
@ansd ansd deleted the utf8-filename-fix branch December 16, 2022 11:56
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.

4 participants