The catalog contains files with names consisting of Russian letters. When I readdir the names of the files in which Russian letters are replaced with question marks come in the callback ? . How to be?

  • nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback So options.encoding like there is - Duck Learning to Hide
  • I write like this var files = fs.readdirSync ('/ nodewebkit / pub / Nrd', {encoding: 'windows-1251'}); Does not work. I tried win1251 - user2497209
  • Hmm, apparently node from box 1251 does not support. Then you need to accept what comes as a buffer (encoding: 'buffer') and drive away the third-party transcoding module. Modules to search in npm for "iconv" and take what will work and enjoy - Duck Learns to Hide

0