   end
 
   def cmd(command) when is_binary(command) do
-    # Notice we don't use unicode for conversion
-    # because the OS is expecting and returning raw bytes
-    :binary.list_to_bin :os.cmd(:binary.bin_to_list(command))
+    String.from_char_data! :os.cmd(List.from_char_data!(command))
   end
 
   @doc """

  * If `:abort`, the runtime system aborts producing a core dump, if that is
    enabled in the operating system;

  * If a char list, an erlang crash dump is produced with status as slogan,
    and then the runtime system exits with status code 1;

  Note that on many platforms, only the status codes 0-255 are supported

  end

  def find_executable(program) when is_binary(program) do
    case :os.find_executable(List.from_char_data!(program)) do
      false -> nil
      other -> String.from_char_data!(other)
    end
  end

