FAQ
*Hi,*

*My file contain data as follow:*
Console.log("aliakhtar");

*I used fs module of node.js to get file data in a variable .*
  var doc = fs.readFileSync(path1, encoding='utf8');
console.log(doc)

*Output:*
Console.log(�aliakhtar�);

*How to get Inveretd comma or you can say string within a string .*

*I used binary ,base64 encoding but didn't work.*

--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Ryan Schmidt at Mar 26, 2014 at 7:58 pm

    On Mar 26, 2014, at 14:18, Ali Akhtar wrote:

    My file contain data as follow:
    Console.log("aliakhtar");

    I used fs module of node.js to get file data in a variable .
    var doc = fs.readFileSync(path1, encoding='utf8');
    console.log(doc)

    Output:
    Console.log(�aliakhtar�);

    How to get Inveretd comma or you can say string within a string .
    I used binary ,base64 encoding but didn't work.
    It sounds like the encoding of the file is not, in fact, utf8, or else it would have worked. Either convert the file to utf8, or specify its correct encoding when reading the file.

    I am not able to reproduce your error when copying your code from this email. Perhaps nonstandard quote characters were converted to standard quote characters when you copied your code into your email.

    --
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Karl Yang at Mar 27, 2014 at 1:46 am
    Right. Make sure your code files' encoding is UTF-8. I think keeping all
    code files UTF-8 is a good habit in developing.


    2014-03-27 3:57 GMT+08:00 Ryan Schmidt <google-2010@ryandesign.com>:
    On Mar 26, 2014, at 14:18, Ali Akhtar wrote:

    My file contain data as follow:
    Console.log("aliakhtar");

    I used fs module of node.js to get file data in a variable .
    var doc = fs.readFileSync(path1, encoding='utf8');
    console.log(doc)

    Output:
    Console.log(�aliakhtar�);

    How to get Inveretd comma or you can say string within a string .
    I used binary ,base64 encoding but didn't work.
    It sounds like the encoding of the file is not, in fact, utf8, or else it
    would have worked. Either convert the file to utf8, or specify its correct
    encoding when reading the file.

    I am not able to reproduce your error when copying your code from this
    email. Perhaps nonstandard quote characters were converted to standard
    quote characters when you copied your code into your email.

    --
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups
    "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    ---
    You received this message because you are subscribed to the Google Groups "nodejs" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupnodejs @
categoriesnodejs
postedMar 26, '14 at 7:18p
activeMar 27, '14 at 1:46a
posts3
users3
websitenodejs.org
irc#node.js

People

Translate

site design / logo © 2022 Grokbase