Re: sending a url with international characters
Re: sending a url with international characters
- Subject: Re: sending a url with international characters
- From: Gino Pacitti <email@hidden>
- Date: Tue, 16 Dec 2003 11:27:21 +0000
Hi Pierre
Let me explain the situation a little more.
The URL is bound to a direct action and I have added a couple or
bindings.
One of them is:
?item = "D|sseldorf"
I have this in the Application Construtor -
WORequest.setDefaultURLEncoding("UTF-8");
The web page is set to encoding - UTF-8
The dictionary for the model has the encoding set to UTF-8 as well
When I pull the value that was submitted I see this - "this is the
title D\374sseldorf"
which is a System.out.println of the String title =
(String)this.request().formValueForKey("item");
And this is the resulting sql statement to retrieve the record
<com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "SELECT
t0.itemID, t0.employer, t0.prePositionOverview, t0.jobName FROM tItem
t0 WHERE t0.location like ? ESCAPE '|' ORDER BY t0.jobName ASC"
withBindings: 1:"D\374sseldorf%"(location)>
Is this correct?
Why cant I get the record which is stored?
Best
Gino
On Tuesday, December 16, 2003, at 01:51 am, Pierre Frisch wrote:
> Hi Gino,
>
> This is a known bug that has been corrected but the solution is poorly
> documented. The problem is that contrary to W3C recommendation
> WebObjects default URL encoding is not UTF-8 and therefore it does not
> work when WebObjects tries to read its own URL with non ASCII
> characters. You can force it to do so by adding a to the query
> dictionary a key "WOURLEncoding" with value "UTF-8" actualy the key
> String is
> com.webobjects.appserver_private.WOURLEncoder.PARAM_WOURLENCODING and
> the value should be _NSUtilities.UTF8StringEncoding. This will add a
> key in your URL that we guarantee the proper decoding of the values.
>
> Pierre
>
> On Dec 15, 2003, at 16:56, Gino Pacitti wrote:
>
>> Hi,
>>
>> I had a problem with characters and was able to sort it out - so all
>> international characters were being saved to the database.
>>
>> But I have hit an other snag:
>>
>> If I have a url like ?location=D|sseldorf the German character gets
>> converted into #FC and when I try to use it as a query in a fetch spec
>> the db does not understand the resulting query. Something like (select
>> .... with bindings D/297sseldorf%)
>>
>> I have tried all measure of things to get the query correct but cannot
>> get it to return the record with the field <location = D|sseldorf>
>>
>> Any help would be greatly appreciated....
>>
>> How do I get the query correct so that I can ask the db for a result
>> set based on a column with an international character?
>>
>> Best
>>
>> Gino
>> _______________________________________________
>> webobjects-dev mailing list | email@hidden
>> Help/Unsubscribe/Archives:
>> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>> Do not post admin requests to the list. They will be ignored.
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.