File tree 7 files changed +22
-3
lines changed
7 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 17
17
18
18
## Global CLI
19
19
* Fix a typo in the variable description returned by "opam var" [ #5961 @jmid ]
20
+ * Out-of-the-box UTF-8 paged --help on Windows [ #5970 @kit-ty-kate ]
20
21
21
22
## Plugins
22
23
89
90
## VCS
90
91
91
92
## Build
93
+ * Upgrade vendored cmdliner to 1.3.0 [ #5970 @kit-ty-kate ]
92
94
93
95
## Infrastructure
94
96
* Ensure GNU coreutils available on the macOS 14 CI runners [ #5938 @dra27 ]
@@ -115,6 +117,7 @@ users)
115
117
## Internal
116
118
117
119
## Internal: Windows
120
+ * Set the console to use UTF-8 on Windows using SetConsoleCP and SetConsoleOutputCP [ #5970 @kit-ty-kate ]
118
121
119
122
## Test
120
123
Original file line number Diff line number Diff line change @@ -483,9 +483,11 @@ let json_out () =
483
483
(Printexc. to_string e)
484
484
485
485
let main () =
486
- if Sys. win32 then
486
+ if Sys. win32 then begin
487
487
(* Disable the critical error handling dialog *)
488
488
ignore (OpamStubs. setErrorMode (1 lor OpamStubs. getErrorMode () ));
489
+ OpamStubs. setConsoleToUTF8 () ;
490
+ end ;
489
491
OpamStd.Sys. at_exit (fun () ->
490
492
flush_all_noerror () ;
491
493
if OpamClientConfig. (! r.print_stats) then (
Original file line number Diff line number Diff line change @@ -41,3 +41,4 @@ let win_create_process _ _ _ _ _ = that's_a_no_no
41
41
let getConsoleWindowClass = that's_a_no_no
42
42
let setErrorMode = that's_a_no_no
43
43
let getErrorMode = that's_a_no_no
44
+ let setConsoleToUTF8 = that's_a_no_no
Original file line number Diff line number Diff line change @@ -142,3 +142,6 @@ val setErrorMode : int -> int
142
142
143
143
val getErrorMode : unit -> int
144
144
(* * Windows only. Directly wraps GetErrorMode. *)
145
+
146
+ val setConsoleToUTF8 : unit -> unit
147
+ (* * Windows only. Directly wraps SetConsoleOutputCP(CP_UTF8). *)
Original file line number Diff line number Diff line change @@ -39,3 +39,4 @@ external getConsoleAlias : string -> string -> string = "OPAMW_GetConsoleAlias"
39
39
external getConsoleWindowClass : unit -> string option = " OPAMW_GetConsoleWindowClass"
40
40
external setErrorMode : int -> int = " OPAMW_SetErrorMode"
41
41
external getErrorMode : unit -> int = " OPAMW_GetErrorMode"
42
+ external setConsoleToUTF8 : unit -> unit = " OPAMW_SetConsoleToUTF8"
Original file line number Diff line number Diff line change 28
28
#include <TlHelp32.h>
29
29
#include <Knownfolders.h>
30
30
#include <Objbase.h>
31
+ #include <WinCon.h>
31
32
32
33
#include <stdio.h>
33
34
@@ -795,3 +796,11 @@ CAMLprim value OPAMW_GetErrorMode(value mode)
795
796
{
796
797
return Val_int (GetErrorMode ());
797
798
}
799
+
800
+ CAMLprim value OPAMW_SetConsoleToUTF8 (value _unit ) {
801
+ /* NOTE: Setting Input (SetConsoleCP) is necessary for more.com
802
+ * called by cmdliner to correctly output UTF-8 characters */
803
+ SetConsoleCP (CP_UTF8 );
804
+ SetConsoleOutputCP (CP_UTF8 );
805
+ return Val_unit ;
806
+ }
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ MD5_re = e0199e32947fd33fcc1b8e69de2308a1
18
18
19
19
$(call PKG_SAME,re)
20
20
21
- URL_cmdliner = https://erratique.ch/software/cmdliner/releases/cmdliner-1.2 .0.tbz
22
- MD5_cmdliner = b860881cc90c68b703dca0f35bdd4cdb
21
+ URL_cmdliner = https://erratique.ch/software/cmdliner/releases/cmdliner-1.3 .0.tbz
22
+ MD5_cmdliner = 662936095a1613d7254815238e11793f
23
23
24
24
$(call PKG_SAME,cmdliner)
25
25
You can’t perform that action at this time.
0 commit comments