///|
extern "c" fn c_windows_utf8_argc() -> Int32 = "jqx_windows_utf8_argc"

///|
extern "c" fn c_windows_utf8_arg_len(index : Int32) -> Int32 = "jqx_windows_utf8_arg_len"

///|
#borrow(out_ptr)
extern "c" fn c_windows_utf8_arg_copy(
  index : Int32,
  out_ptr : Bytes,
  out_len : Int32,
) -> Int32 = "jqx_windows_utf8_arg_copy"

///|
fn utf8_decode_bytes_lossy_prefix(bytes : Bytes, len : Int32) -> String {
  let ints = []
  for i in 0.. {
        buf.write_char(code.unsafe_to_char())
        i += width
      }
      None => {
        buf.write_char('\u{fffd}')
        i += 1
      }
    }
  }
  buf.to_string()
}

///|
fn read_cli_args_internal() -> Array[String] {
  let fallback = @env.args()
  let argc = c_windows_utf8_argc()
  if argc <= 0 {
    return fallback
  }
  let out = []
  for i in 0..