From: Philipp Hahn <hahn@univention.de>
To: Xiaodong Gong <gordongong0350@gmail.com>,
stefanha@gmail.com, kwolf@redhat.com, arei.gonglei@huawei.com,
rudy.zhangmin@huawei.com, jcody@redhat.com, cyliu@suse.com,
petrutlucian94@gmail.com, ssdxiao@163.com
Cc: Xiaodong Gong <gongxiaodong1@huawei.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v10] Support vhd type VHD_DIFFERENCING
Date: Wed, 04 Mar 2015 23:15:39 +0100 [thread overview]
Message-ID: <54F7840B.8010707@univention.de> (raw)
In-Reply-To: <1425478712-4146-1-git-send-email-gongxiaodong1@huawei.com>
Hi,
On 04.03.2015 15:18, Xiaodong Gong wrote:
> @@ -157,6 +178,224 @@ static int vpc_probe(const uint8_t *buf, int buf_size, const char *filename)
..
> +static int vpc_decode_maxc_loc(BlockDriverState *bs, uint32_t data_length)
...
> + cd = g_iconv_open("ASCII", "UTF8");
...
> +static int vpc_decode_w2u_loc(BlockDriverState *bs, uint32_t data_length)
...
> + cd = g_iconv_open("ASCII", "UTF-16LE");
Please correct me if my understanding is wrong, but a hard-coded "ASCII"
is AFAIK wrong, as it only contains the 7-bit characters.
For the Linux kernel the file name is just a string of bytes, but when
it gets displayed to the user, the bytes are converted to characters.
The conversion depends on the locale used, which now-adays is most often
UTF-8 (LANG=de_DE.UTF-8, or more specifically LC_CTYPE), but some years
back it was ISO-8859-1 (or what-ever).
So if I create a backing file with some non-ASCII umlauts, the
conversion will break, as ß = ß = \uc39f = ISO-8859-1(0xdf)
AFAIK using nl_langinfo(CODESET) would return the codeset previously set
by setlocale(LC_ALL, ""), which any main program would need to do.
Am I missing something?
Sincerely
Philipp
next prev parent reply other threads:[~2015-03-04 22:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-04 14:18 [Qemu-devel] [PATCH v10] Support vhd type VHD_DIFFERENCING Xiaodong Gong
2015-03-04 22:15 ` Philipp Hahn [this message]
2015-03-08 1:53 ` Xiaodong Gong
2015-03-08 10:53 ` Philipp Hahn
2015-03-11 6:22 ` Xiaodong Gong
2015-03-11 8:55 ` Philipp Hahn
2015-03-12 11:32 ` Xiaodong Gong
2015-04-16 18:26 ` John Baboval
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=54F7840B.8010707@univention.de \
--to=hahn@univention.de \
--cc=arei.gonglei@huawei.com \
--cc=cyliu@suse.com \
--cc=gongxiaodong1@huawei.com \
--cc=gordongong0350@gmail.com \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=petrutlucian94@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=rudy.zhangmin@huawei.com \
--cc=ssdxiao@163.com \
--cc=stefanha@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.