Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out Unicode in SI_Unit conversion #1506

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/alire/alire-directories.adb
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,16 @@ package body Alire.Directories is
Default_Aft => 1,
Unit => "B");
begin
return TTY.Emph (Image (Modular_File_Size (Size)));
-- The SI_Units library returns a UTF-8 string, sometimes using special
-- characters for non-breaking space and degrees/micro signs. To avoid
-- having to update all of CLIC to Unicode (although we should at some
-- point), just filter it out here

return TTY.Emph
(AAA.Strings.Replace
(Text => Image (Modular_File_Size (Size)),
Match => Character'Val (16#C2#) & Character'Val (16#A0#),
Subst => " "));
end TTY_Image;

---------------
Expand Down