Skip to content

Commit

Permalink
Use the proper mechanisms for UTF-8!
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Jun 10, 2024
1 parent f3c0b69 commit 725e63c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/client/opamClient.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1676,8 +1676,11 @@ let get_redirected_root () =
in
let r = OpamConsole.colorise `bold (OpamFilename.Dir.to_string root) in
let collision =
(* UTF-8 <U+0020, U+1F4A5> (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
Expand Down
1 change: 1 addition & 0 deletions src/core/opamConsole.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions src/core/opamConsole.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 725e63c

Please sign in to comment.