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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:34:30+00:00 2026-06-12T06:34:30+00:00

This is my ASP webservice that queries the db and provides a Json file/object:

  • 0

This is my ASP webservice that queries the db and provides a Json file/object:

<!--#include file="JSON_2.0.4.asp"-->
<!--#include file="JSON_UTIL_0.1.1.asp"-->
<%
Response.CodePage = 28591 
Response.CharSet = "ISO-8859-1"

'response.write("ç ã â é À á") -> characters are written correctly with or without the two lines above but not the json feed

Set Connection = Server.CreateObject("ADODB.Connection")
Set Recordset = Server.CreateObject("ADODB.Recordset")  
Connection.Open "Provider=sqloledb;SERVER=localhost;DATABASE=DB;UID=user;PWD=PASS;" 
QueryToJSON(Connection,"select field1, field2, field3, field4, FROM table").flush
%>

The response text:

[{“col1″:”value1″,”col2″:”value1″,”col3″:”value1”},
{“col1″:”value2″,”col2″:”value2″,”col3″:”value2”},
{“col1″:”value3″,”col2″:”value3″,”col3″:”value3”}]

The response json is not properly encoded replacing punctuation marks “\u00E9” and adding a lot of spaces in the middle and in the end of the values.
When I open this file directly in the browser it looks ok in exception of the replaced characters, but when I feed it as a xmlhttp.responseText to the IndexedDB it appears in the console.log with a lot of spaces and line breaks throwing a “DataError: Data provided to an operation does not meet requirements.” error.
I think the spaces and line breaks might be cause by the replaced characters, something like this “\n”

Update:

I’ve tried using "xhr.setRequestHeader( "Content-Type", "application/json", "Charset=ISO-8859-1");" in my ajax request but it’s not working either

  • 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-12T06:34:31+00:00Added an answer on June 12, 2026 at 6:34 am

    Just figured it out!
    The query to the DB was retrieving the fields with spaces at the end that were being somehow incremented as the program ran, just changed the query line to:

     QueryToJSON(Connection,"select rtrim(field1) field1, rtrim(field2) field2, rtrim(field3) field3, rtrim(field4) field4 FROM table").flush
    

    Now the response is clean and already accepting the correct charset.

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

Sidebar

Related Questions

This question is regarding the ASP.NET webservice that i am creating using the DAL-BLL
I'm developing an asp.net webservice application to provide json-formatted data to a widget that
I have an ASP.NET webservice that returns JSON. Now, using jQuery I want to
I am passing 4 Parameters to an asp.net Webservice. This is my Code so
In this asp.net page, there is a link that leads to another page in
So I have this asp.net web application that I renamed. I changed the assembly
So I have this ASP.Net 2.0 website that uses functions contained within a JS
I've got this ASP.NET 2.0 website project in Visual Studio that I've been working
I have my iPhone app that calls an ASP.NET Webservice to download data. Most
I'm running an ASP.NET WebService on IIS 6.0 that shows a lot of HTTP

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.