Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138221

Getting black diamond question mark while reading csv file in node js

$
0
0

I have a csv file with text as: The right curly single quote mark is ’ and right curly double quote mark is ”.

I am getting text as: The right curly single quote mark is � and right curly double quote mark is �.

I have used node fs module to read file with utf8 encoding as describe below:

var express = require('express');
var app = express();
var fs = require("fs");

app.get('/', function (req, res) {
  var data = fs.readFileSync('abc.csv',{encoding: 'utf8'});
  res.send(data);
})

var server = app.listen(8080, function () {});

Can anyone help me to fetch correct data for curly single quote and curly double quote?


Viewing all articles
Browse latest Browse all 138221

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>