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 6890533
In Process

The Archive Base Latest Questions

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

The Facebook graph API’s return to me the user’s email address as foo\u0040bar.com .

  • 0

The Facebook graph API’s return to me the user’s email address as

foo\u0040bar.com.

in a JSON object. I need to convert it to

foo@bar.com.

There must be a built in method in .NET that changes the Unicode character expression (\u1234) to the actual unicode symbol.

Do you know what it is?

Note: I prefer not to use JSON.NET or JavaScriptSerializer for performance issues.

I think the problem is in my StreamReader:

        requestUrl = "https://graph.facebook.com/me?access_token=" + accessToken;
        request = WebRequest.Create(requestUrl) as HttpWebRequest;
        try
        {
            using (HttpWebResponse response2 = request.GetResponse() as HttpWebResponse)
            {
                // Get the response stream  
                reader = new StreamReader(response2.GetResponseStream(),System.Text.Encoding.UTF8);
                string json = reader.ReadToEnd();

I tried different encodings for the StreamReader, UTF8, UTF7, Unicode, … none worked.

Many thanks!

Thanks to L.B for correcting me. The problem was not in the StreamReader.

  • 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:17:39+00:00Added an answer on May 27, 2026 at 6:17 am

    Json responses are not binary data to convert to a string using some encodings. Instead they are strings correctly decoded by your browser or by HttpWebResponse as in your example. You need a second procesing on it(regex, deserializers etc) to get the final data.

    See what you get with
    webClient.DownloadString("https://graph.facebook.com/HavelVaclav?access_token=????") without any encoding

    {"id":"100000042150992",
        "name":"Havel V\u00e1clav",
        "first_name":"Havel",
        "last_name":"V\u00e1clav",
        "link":"http:\/\/www.facebook.com\/havel.vaclav",
        "username":"havel.vaclav",
        "gender":"male",
        "locale":"cs_CZ"
    }
    

    Would your encoding change \/ to /?

    So, the problem is not in your StreamReader.

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

Sidebar

Related Questions

Facebook graph API tells me I can get a profile picture of a user
Fetching http://graph.facebook.com/514417 from the Facebook Graph API gives me the NSString @http://www.facebook.com/mattdipasquale . How
I am using Facebook graph API and getting its result in json format.. I
Facebook Graph API allows getting Facebook objects like posts, videos etc in JSON from.
I'm using the Facebook Graph API and want to check if a user has
I'm using the Facebook Graph Api to load all friends of the current user
I'm interested in using the facebook graph api to pass an email and obtain
I'm using this library for Facebook graph API access within my codeigniter project: http://www.haughin.com/code/facebook/
i'm working with facebook graph API and i need to get the number of
I want to access the Facebook Graph API and get JSON responses like this:

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.