I am using UNIX function symlink()
to link a path that contains Unicode characters. However, when I read the link, it is returning ?
instead of Unicode characters.
This is what my method looks like :
if (symlink("symlink.jpg", "/real/path/光芒.jpg") != 0)
warn("symlink() error\n");
else //symlink creation successful
The symlink is created successfully at this point, however the link looks something like this:
symlink.jpg -> /real/path/??.jpg
I was expecting the link to look like this:
symlink.jpg -> /real/path/光芒.jpg
Can anyone tell me why this is happening? Any fix or alternative library/function recommendation would be appreciated.
Additional information:
- I am suspecting that library
unistd.h
orfcntl.h
might not have unicode support. Because when I usecreat()
oropen()
to create a new file called光芒.jpg
, it actually creates a file called??.jpg
. - My development environment and compiler has unicode support. For example,
fprint()
can use unicode characters.