473,463 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

X-JSON encoding problem

Hi,
I have problem with X-JSON. I am sending, in header, Polish chars,
that are correct encoded in database, but when they came through
header something wrong happen with encoding and I can only see
strange
signs at page. I am using UTF-8.

Please help, because all my ajax requests are based on sending data
in
header.

Sincerely,
Gene
Jun 27 '08 #1
2 1912
Gene ha scritto:
Hi,
I have problem with X-JSON. I am sending, in header, Polish chars,
that are correct encoded in database, but when they came through
header something wrong happen with encoding and I can only see
strange
signs at page. I am using UTF-8.

Please help, because all my ajax requests are based on sending data
in
header.
{data: base64_encode(stringdata)}
Sincerely,
Gene
Jun 27 '08 #2
Gufo Rosso wrote:
Gene ha scritto:
>I have problem with X-JSON. I am sending, in header, Polish chars,
HTTP headers can only contain ASCII characters.
>that are correct encoded in database,
There are many choices to store Polish characters: ISO 8859-2,
Windows-1250, ISO-IR 101, UTF-7, UTF-8, UTF-16, ... None of those is
more "correct" than the other.
>but when they came through header something wrong happen with
encoding and I can only see strange signs at page. I am using UTF-8.
What are these strange signs ? When you want UTF-8, I suspect that,
for example, a Polish character like:

\u017a (LATIN SMALL LETTER Z WITH ACUTE)

from database could be displayed on your screen like:

\u00c5\u00ba (LATIN CAPITAL LETTER A WITH RING ABOVE, followed
by MASCULINE ORDINAL INDICATOR)

This means that the two-byte sequence is not recognized as UTF-8.

There are three actors involved:
- Which encoding is used by the database
- How it read by the app and transferred (Content-Type header)
- How the webpage displays the data
>Please help, because all my ajax requests are based on sending data
in header.

{data: base64_encode(stringdata)}
Base64-encodings should only be used to transfer binary data over 7-
bit paths. It makes no sense to use it for UTF-8. You are
theoretically correct that the data will be ASCII-safe (as required
for HTTP headers), but far too big to be stored there. The body-part
of the message is intended for this task.

Hope to have helped more than confused,

--
Bart
Jun 27 '08 #3

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

Similar topics

2
by: CMan | last post by:
Hi, I am reading a text file using a StreamReader in C# but the reader is unable to handle some of the characheters. Using the default encoding the program cannot handle accented characters. I...
8
by: Demon News | last post by:
I'm trying to do a transform (Using XmlTransform class in c#) and in the Transform I'm specifying the the output xsl below: <xsl:output method="xml" encoding="UTF-8" indent="no"/> the...
3
by: David Taylor | last post by:
In .net I am using a HttpWebRequest to read from a WebSite. I am getting everything back except for some characters above hex 7F which appear to have been stripped out of my response. I see these...
2
by: WEIWEIWEI | last post by:
Hi Al I'd like to encode a string submitted from a utf-8 form in a aspx page to big5 Any ideas on how to do that I try sth like public static string unicode_big5(string src) { Encoding big5...
2
by: Alex Maghen | last post by:
I have created the world's simplest Code-Behind ASPX page in VS 2005. I've used all the defaults. But when I go to build and run the page, it comes up in Chinese (or some Asian character set). I've...
4
by: shreshth.luthra | last post by:
Hi All, I am having a GUI which accepts a Unicode string and searches a given set of xml files for that string. Now, i have 2 XML files both of them saved in UTF-8 format, having characters...
4
by: flyingco | last post by:
URL decoding/encoding problem Iif the url contains chinese char,the url will be encoded. For example : url:http://194.0.0.84/ÖÐÎÄÒ³Ãæ.htm when my tdi driver intercept the packet, I find that...
0
by: Serdar Irmak | last post by:
Hello, I've an encoding problem with asp.net 2.0 pages, it only effects to the input elements of forms that the client submitted, all other page content can be displayed normally including...
5
by: bagelman | last post by:
Hello, I've an encoding problem with asp.net 2.0 pages, it only effects to the content of textBox elements. When user press Submit button and page become postback the strings in textBox become...
2
by: David Gillen | last post by:
Hello. I've a problem (which I believe is a character encoding problem) where I retrieve data from a MSSQL database and euro and pound sign symbols appear as ? when a do a print_r of the rows...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.