Re: dealing with utf8 filenames
- From: "Alan M. Evans" <ame1 extratech com>
- To: Christian Neumair <chris gnome-de org>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: dealing with utf8 filenames
- Date: Wed, 22 Feb 2006 11:02:33 -0800
On Wed, 2006-02-22 at 10:47, Christian Neumair wrote:
For the sake of readability, I'd rather use the following code:
char **str;
/* str[0]: basename
str[1]: extension */
str = g_strsplit (filename, ".", 2);
g_strfreev(str)
Surely that won't work if there is more than one dot in the name!
Why? :)
Because the file "myprog-1.2.3.tar.gz" will be split into:
basename="myprog-1" and extension="2.3.tar.gz", which is incorrect for a
file name and incorrect for an extension.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]