Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
7149a8ae
Commit
7149a8ae
authored
Jan 24, 2013
by
Denis Krjuchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Path: merge utf8_to_fs_charset() into Path::FromUTF8()
parent
3c7cf946
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
13 deletions
+4
-13
Path.cxx
src/fs/Path.cxx
+2
-3
Path.hxx
src/fs/Path.hxx
+2
-10
No files found.
src/fs/Path.cxx
View file @
7149a8ae
...
...
@@ -75,8 +75,7 @@ std::string Path::ToUTF8(const_pointer path_fs)
return
std
::
string
(
path_utf8
,
sizeof
(
path_utf8
)
-
out_left
);
}
char
*
utf8_to_fs_charset
(
const
char
*
path_utf8
)
Path
Path
::
FromUTF8
(
const
char
*
path_utf8
)
{
gchar
*
p
;
...
...
@@ -87,7 +86,7 @@ utf8_to_fs_charset(const char *path_utf8)
/* fall back to UTF-8 */
p
=
g_strdup
(
path_utf8
);
return
p
;
return
Path
(
Donate
(),
p
)
;
}
gcc_pure
...
...
src/fs/Path.hxx
View file @
7149a8ae
...
...
@@ -48,13 +48,6 @@ void path_global_init();
void
path_global_finish
();
/**
* Converts a file name in UTF-8 to the filesystem charset. Returns a
* duplicate of the UTF-8 string on failure.
*/
char
*
utf8_to_fs_charset
(
const
char
*
path_utf8
);
const
char
*
path_get_fs_charset
();
/**
...
...
@@ -157,14 +150,13 @@ public:
/**
* Convert a UTF-8 C string to a #Path instance.
* Returns a duplicate of the UTF-8 string on failure.
*
* TODO: return a "nulled" instance on error and add checks to
* all callers
*/
gcc_pure
static
Path
FromUTF8
(
const
char
*
utf8
)
{
return
Path
(
Donate
(),
utf8_to_fs_charset
(
utf8
));
}
static
Path
FromUTF8
(
const
char
*
path_utf8
);
/**
* Convert the path to UTF-8.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment