Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6890617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:18:18+00:00 2026-05-27T06:18:18+00:00

I’m using Redis 2.2.11 with Node on Ubuntu 11.10, and I’m saving a string

  • 0

I’m using Redis 2.2.11 with Node on Ubuntu 11.10, and I’m saving a string but it’s being returned as a Buffer.

    id = 1234;
    console.log('data', data);
    client.hmset("user:" + id, "name", data['name'] );
    client.hmget('user:' + id, "name", function(err, d) {
        console.log('data retrieved', d);
    });

This produces the following at the console:

data { name: 'RealServer' }
data retrieved [ <Buffer 41 6e 6e 61 52 65 61 6c 53 65 72 76 65 72> ]

Why is it going in as a string, and coming out as a Buffer?
The Buffer makes debugging very difficult!

On my local setup (MacOS 10.6 with Redis 2.2.14) the data retrieved prints as a string, just fine. I’d like to find a solution that continues to work on both systems.

UPDATE: It also works fine without an encoding specified on CentOS 5.7. Is this something specific to Ubuntu? Is there a system-wide fix?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:18:19+00:00Added an answer on May 27, 2026 at 6:18 am

    See: http://nodejs.org/docs/v0.3.1/api/buffers.html

    Pure Javascript is Unicode friendly but not nice to binary data. When
    dealing with TCP streams or the file system, it’s necessary to handle
    octet streams. Node has several strategies for manipulating, creating,
    and consuming octet streams.

    Raw data is stored in instances of the Buffer class. A Buffer is
    similar to an array of integers but corresponds to a raw memory
    allocation outside the V8 heap. A Buffer cannot be resized.

    The Buffer object is global.

    Converting between Buffers and JavaScript string objects requires an
    explicit encoding method.

    Because you’ve not specified an encoding, it displays as raw data by default. You can use buffer.toString to produce a standard JS string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to construct a data frame in an Rcpp function, but when I
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.