Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i create a unicode filename in linux?

I heard fopen supports UTF8 but i dont know how to convert an array of shorts to utf8

How do i create a file with unicode letters in it? I prefer to use only built in libraries (no boost which is not installed on the linux box). I do need to use fopen but its pretty simple to.


1 Answers

fopen(3) supports any valid byte sequence; the encoding is unimportant. Use nl_langinfo(3) with CODESET to get what charset you should use for the encoding, and libiconv or icu for the actual encoding.

like image 180
Ignacio Vazquez-Abrams Avatar answered Dec 12 '25 19:12

Ignacio Vazquez-Abrams