Skip to content

try catch not work if path include unicode #51802

@Plumbiu

Description

@Plumbiu

Version

v20.10.0

Platform

Microsoft Windows NT 10.0.22621.0 x64

Subsystem

node:internal/fs/promises

What steps will reproduce the bug?

run code:

import fsp from 'node:fs/promises'

async function run() {
  try {
    await fsp
      .readdir('中文-にほんご-한글-🌕🌖🌗', {
        withFileTypes: true,
        encoding: 'utf-16le',
      })
      .catch((error) => {})
  } catch (error) {}
}

run()

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

No Error in terminal

What do you see instead?

Error in terminal:

image

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    errorsIssues and PRs related to JavaScript errors originated in Node.js core.fsIssues and PRs related to the fs subsystem / file system.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions