From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: aidan_leuck@selinc.com
Cc: qemu-devel@nongnu.org, micheal.roth@amd.com, kkostiuk@redhat.com
Subject: Re: [PATCH] Implement SSH commands in QEMU GA for Windows
Date: Wed, 20 Mar 2024 15:20:56 +0400 [thread overview]
Message-ID: <CAJ+F1CLWCpHSgzuXVaV6EBWRQKM42UaSiivCHjzJGkbW26UNLA@mail.gmail.com> (raw)
In-Reply-To: <20240319181724.212753-1-aidan_leuck@selinc.com>
Hi
On Wed, Mar 20, 2024 at 12:39 AM <aidan_leuck@selinc.com> wrote:
> +// Converts from a standard string to a Windows wide string.
> +// it is a 16-bit wide character used to store Unicode encoded as UTF-16LE/
> +// some Windows API functions require this format of the string as opposed to just
> +// the normal c char*. This function attempts to convert a standard string to
> +// a wide string if it is possible. Some multibyte characters are not supported
> +// so it could throw an error.
> +// Read more here:
> +// https://learn.microsoft.com/en-us/cpp/cpp/char-wchar-t-char16-t-char32-t?view=msvc-170
> +// parameters:
> +// string - String to convert to a wchar.
> +// errp - Error pointer that will set errors if they are converted
> +// returns - The converted string or NULL if an error occurs.
> +static wchar_t *string_to_wide(const char *string, Error **errp)
> +{
There is g_utf8_to_utf16() which can be cast to wchar_t, iirc, that's
how glib converts string for w32 api
--
Marc-André Lureau
next prev parent reply other threads:[~2024-03-20 11:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-19 18:17 [PATCH] Implement SSH commands in QEMU GA for Windows aidan_leuck
2024-03-20 11:05 ` Daniel P. Berrangé
2024-03-20 11:20 ` Marc-André Lureau [this message]
2024-03-20 12:27 ` Konstantin Kostiuk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJ+F1CLWCpHSgzuXVaV6EBWRQKM42UaSiivCHjzJGkbW26UNLA@mail.gmail.com \
--to=marcandre.lureau@gmail.com \
--cc=aidan_leuck@selinc.com \
--cc=kkostiuk@redhat.com \
--cc=micheal.roth@amd.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).