From 725e63c7594f4804489ec359794f13d0181ce5ff Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Mon, 10 Jun 2024 11:31:50 +0100 Subject: [PATCH] Use the proper mechanisms for UTF-8! --- src/client/opamClient.ml | 7 +++++-- src/core/opamConsole.ml | 1 + src/core/opamConsole.mli | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/client/opamClient.ml b/src/client/opamClient.ml index 65ed5e1d0dc..53df62cc682 100644 --- a/src/client/opamClient.ml +++ b/src/client/opamClient.ml @@ -1676,8 +1676,11 @@ let get_redirected_root () = in let r = OpamConsole.colorise `bold (OpamFilename.Dir.to_string root) in let collision = - (* UTF-8 (Collision emoji) *) - if OpamConsole.color () then " \xF0\x9F\x92\xA5" else "" + let collision = OpamConsole.utf8_symbol OpamConsole.Symbols.collision "" in + if collision = "" then + "" + else + " " ^ collision in let options = [ `Redirect, Printf.sprintf diff --git a/src/core/opamConsole.ml b/src/core/opamConsole.ml index 58143463779..4188918f024 100644 --- a/src/core/opamConsole.ml +++ b/src/core/opamConsole.ml @@ -105,6 +105,7 @@ module Symbols = struct let downwards_double_arrow = Uchar.of_int 0x21d3 let black_down_pointing_triangle = Uchar.of_int 0x25bc let downwards_black_arrow = Uchar.of_int 0x2b07 + let collision = Uchar.of_int 0x1f4a5 end type win32_glyph_checker = { diff --git a/src/core/opamConsole.mli b/src/core/opamConsole.mli index 869d9447ce4..ce2cb279361 100644 --- a/src/core/opamConsole.mli +++ b/src/core/opamConsole.mli @@ -66,6 +66,7 @@ module Symbols : sig val downwards_double_arrow : Uchar.t val downwards_black_arrow : Uchar.t val black_down_pointing_triangle : Uchar.t + val collision : Uchar.t end val utf8_symbol: