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

  • SEARCH
  • Home
  • 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 8113953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:59:46+00:00 2026-06-06T02:59:46+00:00

I have a JSON file which contains a pound symbol in it. This json

  • 0

I have a JSON file which contains a pound symbol in it. This json is pulled from a file stored on the phone temporarily. It will come from a server, but for time being I am just storing it on the phone. I convert the JSON file to an input stream and use a method to convert it to a string like this

Resources res = getResources();
String sJsonVariables = iStream_to_String(res
                .openRawResource(R.raw.widgvariables));

The iStream_to_String method is this

public String iStream_to_String(InputStream is) {
        BufferedReader rd = new BufferedReader(new InputStreamReader(is), 4096);
        String line;
        StringBuilder sb = new StringBuilder();
        try {
            while ((line = rd.readLine()) != null) {
                sb.append(line);
            }
            rd.close();

        } catch (IOException e) {
            e.printStackTrace();
        }
        String contentOfMyInputStream = sb.toString();
        return contentOfMyInputStream;
    }

I have tried printing out the json using Log.v to test it is printing out okay. Everything prints out fine except for the pound symbol. I have tried several different ways of encoding it like this

byte []b = sJsonVariables.getBytes();

        String s1 = new String(b, "UTF-8");
        String s2 = new String(b, "ASCII");
        String s3 = new String(b, "Cp1252");
        String s4 = new String(b, "ISO8859_1");

However none of them will print out the pound symbol, it either comes out as a black question mark or some other weird symbol. Does anyone know what I am doing wrong, and how I can get this symbol to print out properly?

  • 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-06-06T02:59:47+00:00Added an answer on June 6, 2026 at 2:59 am

    Use this as well with try catch byte []b = sJsonVariables.getBytes("UTF8"); and the String with String s3 = new String(b, "Cp1252");

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

Sidebar

Related Questions

I have a json file which contains questions and answers like this. { Questions:
I have a flash file which loads data from JSON and parses it. It
I have an iPhone app which gets a response from a php file. This
I have a JSON file which contains data like the following: {"posts": [ {
I have a json.php file which delivers results like this: { markers: [ {'a1_id':4213CK58,
I have a JSON file which is populated to an activity (Main.java). This Activity
I have a JSON file which contains HTML content. I want to load it
I have a file which contains two JSON arrays; one is holding the column
I am building a android aplication which will be consuming a json file from
I have parse json file which contain more than hundred location name, there latitude

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.