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

Home Posts Topics Members FAQ

Passing extended chars

I sometimes need to find a set of records via PHP/SQL with
non-English/extended characters fed to the query via a hyperlink.

For example, I have a navigation link on a site that tries to pass the
phrase "Gesundheit und Schönheit" via http with the extended character
(ö) correctly encoded as an HTML entity (ö)

http://www.domain.com/page.php?indus...Schönheit

However "Gesundheit und Schönheit" is not passed to my variable, only
"Gesundheit und Sch". I reckon the ampersand is causing trouble.

If correctly encoding extend chars as html entities isn't working for
what I want, how can I encode them for storage in XHTML or otherwise get
the result I want?

TIA,

Sean
Jul 17 '05 #1
2 1415
Sean O'Dwyer <no****@spamfree.dud> wrote:
phrase "Gesundheit und Sch?nheit" via http with the extended character
(?) correctly encoded as an HTML entity (&ouml;)

http://www.domain.com/page.php?indus...Sch&ouml;nheit [snip] If correctly encoding extend chars as html entities isn't working for
what I want, how can I encode them for storage in XHTML or otherwise get
the result I want?


You are creating an _URL_ so if you want/need encode a tring for passing
in the _URL_ you need to _URL encode_ it:
http://php.net/rawurlencoda
and
http://php.net/urlencode

BTW read the note under exmaple 1 of last url.
Jul 17 '05 #2
Sean O'Dwyer wrote:
http://www.domain.com/page.php?indus...Sch&ouml;nheit
(Is that an example? If so, please follow RFC2606 and use
reserved domain names which won't conflict with current or
future ones; e.g., <http://host.invalid/>.)

URIs are made up of only a subset of US-ASCII, so after the
entity &ouml; is replaced, that isn't a URI. You can
convert that IRI to a URI by converting 'ö' (U+00F6) to its
UTF-8 encoding and then percent-encode each octet. Thus

http://www.domain.com/page.php?indus...Sch%C3%B6nheit

I don't know what happens in the wild, but that's the
ratified way of encoding characters that are not allowed in
URIs. See RFC3987 sec. 3.1.

http://www.ietf.org/rfc/rfc3987.txt

Here's how the expert Martin Dürst set up his URI:

http://www.w3.org/People/D%C3%BCrst/URI.html
However "Gesundheit und Schönheit" is not passed to my variable, only
"Gesundheit und Sch". I reckon the ampersand is causing trouble.


&ouml; is simply a way to represent the character LATIN
SMALL LETTER O WITH DIAERESIS in HTML. The trouble is that
that character is not allowed unencoded in URIs.

--
Jock
Jul 17 '05 #3

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

Similar topics

2
by: Christian Wilcox | last post by:
I'm trying to programmatically access information from a telnet session which is normally accessed with a telnet program capable of terminal emulation (currently set at VT320). The initial login...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
1
by: | last post by:
Hey all, Quick question...been bugging me for some time, really. I have a console app, it does some things, and I want to save an array of text to a text file. The text consists of ASCII and...
0
by: brrrdog | last post by:
Whenever I write to Response.Outputstream after doing a plain response.write, I get a delimiter between the two writes that is made up of three extended ascii chars (decimal equivalents 239,...
3
by: James Pahiris | last post by:
Is there any way to store an extended ascii char in visual basic .net In previous VB chr$(254) ' â–  I need to send ascii chars (8 bit) to a serial port Thanks for any help.
4
by: Christian Maier | last post by:
Hi After surfing a while I have still trouble with this array thing. I have the following function and recive a Segmentation fault, how must I code this right?? Thanks Christian Maier
5
by: aagarwal8 | last post by:
Hi, I want to display the extended ASCII charset in the list view (in List mode), but when i assign any of the Ex. ASCII chars to the listview item text, it renders blank. Any idea how i can...
0
by: jumperbl | last post by:
I am converting hex to ASCII and one of the words has a dot in the middle, which is in the extended ascii characters. when i do this i get the ascii chars. ...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
1
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...
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.