473,408 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Error decoded 8 bit characters.

Hello:

We ran into an issue with the decoding 8 bit characters. We have an
asp page that makes a call to an ashx page. When the HTTPHandler
accesses the query string we find that the 8 bit characters are
stripped. The source asp page is encoding using ISO-Western European
(windows-1252) single byte encoding. I am assuming that the .Net
framework uses the Unicode (UTF8) as the basis for decoding the URL.
Now we managed to get this to work by explicitly requesting that the
HTTPHandler use Windows-1252 for encoding/decoding:

<globalization
requestEncoding="Windows-1252"
responseEncoding="Windows-1252"/>

This works when the URL is passed using a single byte encoding but it
breaks when multi-byte encoding on the URL is used by the source page.
SO the solution is not extensible. This brings up a few questions:

1) Is there a way to programatically indicate the responseEncoding
using an aspx page.
2) Has anyone had luck with a more flexible approach to handling the
encoding/decoding of characters w/o have in to hard code the encoding
in the web.config.

Please let me know,
Thanks
Nov 18 '05 #1
2 1603
T Conti wrote:
Hello:

We ran into an issue with the decoding 8 bit characters. We have an
asp page that makes a call to an ashx page. When the HTTPHandler
accesses the query string we find that the 8 bit characters are
stripped. The source asp page is encoding using ISO-Western European
(windows-1252) single byte encoding. I am assuming that the .Net
framework uses the Unicode (UTF8) as the basis for decoding the URL.
Now we managed to get this to work by explicitly requesting that the
HTTPHandler use Windows-1252 for encoding/decoding:

<globalization
requestEncoding="Windows-1252"
responseEncoding="Windows-1252"/>

This works when the URL is passed using a single byte encoding but it
breaks when multi-byte encoding on the URL is used by the source page.
SO the solution is not extensible. This brings up a few questions:

1) Is there a way to programatically indicate the responseEncoding
using an aspx page.
Yes. You can set the property HttpResponse.ContentEncoding.
2) Has anyone had luck with a more flexible approach to handling the
encoding/decoding of characters w/o have in to hard code the encoding
in the web.config.


On general: if your clients are properly communicating the appropriate
encoding, you can retrieve that value from the HTTP request and apply it. If
they don't, you're out of luck.

Cheers,

--
Joerg Jooss
jo*********@gmx.net

Nov 18 '05 #2
T Conti wrote:
Hello:

We ran into an issue with the decoding 8 bit characters. We have an
asp page that makes a call to an ashx page. When the HTTPHandler
accesses the query string we find that the 8 bit characters are
stripped. The source asp page is encoding using ISO-Western European
(windows-1252) single byte encoding. I am assuming that the .Net
framework uses the Unicode (UTF8) as the basis for decoding the URL.
Now we managed to get this to work by explicitly requesting that the
HTTPHandler use Windows-1252 for encoding/decoding:

<globalization
requestEncoding="Windows-1252"
responseEncoding="Windows-1252"/>

This works when the URL is passed using a single byte encoding but it
breaks when multi-byte encoding on the URL is used by the source page.
SO the solution is not extensible. This brings up a few questions:

1) Is there a way to programatically indicate the responseEncoding
using an aspx page.
Yes. You can set the property HttpResponse.ContentEncoding.
2) Has anyone had luck with a more flexible approach to handling the
encoding/decoding of characters w/o have in to hard code the encoding
in the web.config.


On general: if your clients are properly communicating the appropriate
encoding, you can retrieve that value from the HTTP request and apply it. If
they don't, you're out of luck.

Cheers,

--
Joerg Jooss
jo*********@gmx.net

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: pekka niiranen | last post by:
Hi there, I have two files "my.utf8" and "my.utf16" which both contain BOM and two "a" characters. Contents of "my.utf8" in HEX: EFBBBF6161 Contents of "my.utf16" in HEX: FEFF6161
1
by: T Conti | last post by:
Hello: We ran into an issue with the decoding 8 bit characters. We have an asp page that makes a call to an ashx page. When the HTTPHandler accesses the query string we find that the 8 bit...
1
by: T Conti | last post by:
Hello: We ran into an issue with the decoding 8 bit characters. We have an asp page that makes a call to an ashx page. When the HTTPHandler accesses the query string we find that the 8 bit...
2
by: prasath03 | last post by:
Hi, I wrote a java program for Encrypt and Decrypt the given string, when i execute the program it show me an error....but the string has Encrypted, if i want to Decrypt the string it show me an...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.