Skip to content

fs.write does not work on external two-byte strings #18146

Description

@joyeecheung
  • Version: master
  • Platform: all
  • Subsystem: fs

Discovered during #18144

// Flags: --expose_externalize_string'use strict';constassert=require('assert');constfs=require('fs');constfile='write-external.txt';constexpected='中文';externalizeString(expected);fs.open(file,'w',0o644,function(err,fd){fs.write(fd,expected,0,'utf8',function(err,written){fs.closeSync(fd);constfound=fs.readFileSync(file,'utf8');fs.unlinkSync(file);assert.strictEqual(expected,found);// AssertionError [ERR_ASSERTION]: '中文' strictEqual '-N�e'});});

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to the fs subsystem / file system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions