473,394 Members | 1,724 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,394 software developers and data experts.

%da is translated before getting to php

Hi,

I'm trying help someone who has a simple search box on their php
web page, into which you can enter an SQL query. The problem is that
sometimes "%da" is interpreted into an accented capital U, as if some
unicode translation was happening somewhere.

It's looks like the translation is already there by the time we
examine http_submit_vars. Is it a setting of the brower ? That seems
unlikely because the URL appears ok in the apache log. I decided it
must be some setting in php.ini, but the only thing that looked like
it might apply was the magic_quotes_gpc setting, and I tried it both
ways and I still have the problem.

Has anyone seen this before ?

--Rob
Jul 17 '05 #1
1 2513
Rob Ristroph wrote:
I'm trying help someone who has a simple search box on their php
web page, into which you can enter an SQL query. The problem is that
sometimes "%da" is interpreted into an accented capital U, as if some
unicode translation was happening somewhere.

It's looks like the translation is already there by the time we
examine http_submit_vars. Is it a setting of the brower ? That seems
unlikely because the URL appears ok in the apache log. I decided it
must be some setting in php.ini, but the only thing that looked like
it might apply was the magic_quotes_gpc setting, and I tried it both
ways and I still have the problem.


This is a character-encoding problem.

If %da is interpreted in iso-8859-1 it will be shown as the accented
capital U

<?php
$x = isset($_GET['data']) ? $_GET['data'] : '(no data)';
header('Content-Type: text/html; charset=iso-8859-1');
echo '<html><head><title>test</title></head><body>';
echo '<p>data is represented as: ', $x, '.</p>';
echo '<p>in hexadecimal that is: ', bin2hex($x), '.</p>';
echo '</body></html>';
?>

Now go to this page with some data in the URL

page.php?data=ooo%daooo
page.php?data=ooo%25daooo
Change charset to one of ( utf-8 | us-ascii | big5 | ... )
and see the differences :-)
--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |
Jul 17 '05 #2

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

Similar topics

1
by: fede | last post by:
Ho visto che su Interdev si può impostare per un progetto ASP la proprietà EnableSessionsDefault a true o false.Qualcuno sa dirmi che effetti ha?E quali le conseguenze? Grazie!
2
by: Lance Riedel | last post by:
I was wondering if anyone has seen/knows of a solution to the following: given a document that has been translated through xsl, if you have a character offset in the translated document, can you...
2
by: Eyal | last post by:
Hey, I would appriciate if anyone can help on this one: I have a java object/inteface having a method with a boolean parameter. As I'm trying to call this method from a javascript it fails on...
10
by: mike | last post by:
regards: Where to find tag mapping-table of HTML translated to XHTML1.0 Any positive suggestion is welcome. thank you May goodness be with you all
14
by: Ryan | last post by:
I want to do the following SQL statement in Access. However, it won't allow me to have the secondary part of my join statement and tells me that this is not supported. OK, so Access doesn't support...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
18
by: kenny | last post by:
I have a String outputhex which consists of unicodetext translated into hex. example: test = 7400650073007400 now i translate each two characters of the hexstring (outputhex) into byte and then...
1
by: sofy | last post by:
Hi all 'm facing a problem in translation/compilation of a .sqlj file.Eventhough the .sqlj file is modified , the translated java file still contains the previous errors.Also only .ser file is...
0
by: Trac Bannon | last post by:
I am using VS 2003. I have an XML file that is generated by Oracle. The file is UTF8 encoded. In my code, I am creating an XMLDataDocument. To load the XMLDataDocument I create a TextReader...
3
tjc0ol
by: tjc0ol | last post by:
Hi guys, Can this remote price javascript code below: <script type="text/javascript" language="javascript"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.