By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,375 Members | 1,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,375 IT Pros & Developers. It's quick & easy.

PHP, MySQL and extended characters

P: n/a

In oracle I can do the following:

select CONVERT(COLUMNOFNAMES,'US7ASCII') from mytable --

It will take a name like Albrecht Dürer and change it into Albrecht
Durer and is useful in where clauses where you do not know if a user is
going to enter u or ü -- I convert the user input into Durer as well
as the column and query against it and get hits ........ very useful.

I can't seem to get something similar working with MySQL --

where ( convert(COLUMNOFNAMES using swe7) like '%durer%'

produces no hits -- I ran a select and it seemed to be convert the ü
into a question mark .... my default character set is latin1 - the
characters are displaying ok in the php pages.

Anybody got a clue if there is anyway to get this working --
essentially diacritic insensative searching. Working great in Oracle
-- but only because of the way the US7ASCII set maps characters like ü
on u ....

Mar 21 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I'm trying to run pages of my site through an automatic translation program
such as babelfish.

I've written a code module translate.php, that gets the URL of the current
page, formats the query string etc. correctly to call babelfish, and then
calls the babelfish translation page using curl.

This actually works, and returns my page, all nicely translated into some
other language.

The problem I've run into is that, after the first translation, the page
comes back with babelfishes URLs prefixed to all URLs in the HTML. So if you
click another link, it also gets translated the same way. Actually, this is
great and wonderful except that I have a series of buttons on the bottom
that translate to different languages. So now the buttons, instead of
calling my translate.php function directly, will attempt to call it through
the translation page first, which totally screws it up.

What I want is the page to come back translated, yet somehow reset only the
certain URLs on the translate buttons so that they again call my
translate.php code directly, without the babelfish prefix.

Am I correct in thinking that I must somehow load the page into memory (from
babelfish), then search through it for the strings I want to replace, and
"edit" the HTML code, before I actually send it for output and display?

Any pointers/tips on doing this, or is there some easier way of dealing with
this? Thanks much.

--
Stephen Kay
Karma-Lab sk@karma-lab.NOSPAM.com
^^^^^^^
Mar 21 '06 #2

P: n/a
On Tue, 21 Mar 2006 21:57:00 GMT, Stephen Kay
<sk@karma-lab.nospam.com> wrote:
Am I correct in thinking that I must somehow load the page into memory (from
babelfish), then search through it for the strings I want to replace, and
"edit" the HTML code, before I actually send it for output and display?

Any pointers/tips on doing this, or is there some easier way of dealing with
this? Thanks much.

I'd say 'yes'.

I think I'd cheat and use javascript write for the ones that you
didn't want to be changed. But I accept that isn't the most
satisfactory solution
--
Locate your Mobile phone: <http://www.bizorg.co.uk/news.html>
Great gifts: <http://www.ThisBritain.com/ASOS_popup.html>
Mar 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.