HI, is there anyfunction unescape javascript's escape() to word

View: New views
5 Messages — Rating Filter:   Alert me  

HI, is there anyfunction unescape javascript's escape() to word

by solrD :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i need to send a chinese word to eXist for fulltext search , it is utf-8
if i use escape('中')
then in eXist get this parameter
how to decode to  word '中'  


thanks.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: HI, is there anyfunction unescape javascript's escape() to word

by Dannes Wessels-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Tue, Jul 1, 2008 at 11:11 AM, ㄏㄨㄚ <dn2965@...> wrote:
> i need to send a chinese word to eXist for fulltext search , it is utf-8
> if i use escape('中') then in eXist get this parameter how to decode to  word '中'

please could you be more clear and more specific?

cheers

Dannes

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: HI, is there anyfunction unescape javascript's escape() to word

by Adam Retter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try -

xmldb:decode() or xmldb:decode-uri()

Thanks Adam.

2008/7/1 ㄏㄨㄚ <dn2965@...>:

> i need to send a chinese word to eXist for fulltext search , it is utf-8
> if i use escape('中')
> then in eXist get this parameter
> how to decode to  word '中'
>
>
> thanks.
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Exist-open mailing list
> Exist-open@...
> https://lists.sourceforge.net/lists/listinfo/exist-open
>
>



--
Adam Retter

eXist Developer
{ England }
adam@...
irc://irc.freenode.net/existdb
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: HI, is there anyfunction unescape javascript's escape() to word

by Wolfgang Meier-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> i need to send a chinese word to eXist for fulltext search , it is utf-8

You don't need any special functions in your query. If the parameter
does really arrive as UTF-8, eXist should process it correctly.

However, you have to make sure the characters are not modified on
their way to eXist. This may already happen in the web browser (if you
are using AJAX, check if the content type header of the HTTP requests
you send does specify UTF-8).

The web server may also think it needs to transcode the characters,
especially if your system does not use UTF-8 as default encoding. You
at least need to pass -Dfile.encoding=UTF-8 on the Java command line
when you start the server process. Otherwise, the Java libraries which
are out of eXist's control may fall back to your system-wide default.

Wolfgang

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: HI, is there anyfunction unescape javascript's escape() to word

by solrD :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



2008/7/1 Wolfgang Meier <wolfgang@...>:
> i need to send a chinese word to eXist for fulltext search , it is utf-8

You don't need any special functions in your query. If the parameter
does really arrive as UTF-8, eXist should process it correctly.

However, you have to make sure the characters are not modified on
their way to eXist. This may already happen in the web browser (if you
are using AJAX, check if the content type header of the HTTP requests
you send does specify UTF-8).

The web server may also think it needs to transcode the characters,
especially if your system does not use UTF-8 as default encoding. You
at least need to pass -Dfile.encoding=UTF-8 on the Java command line
when you start the server process. Otherwise, the Java libraries which
are out of eXist's control may fall back to your system-wide default.

Wolfgang


sorry everyone ...  many days ago 
i want to use javascript to operat a iframe element to change  its url attribute
so

var param1='中國';
var url='http://localhost/***/some.xq?'+param1;

$('#id').attr("url",url);

...(it is not word in opera and IE)

today i tried a example in sandbox/script/sandbox.js
function escapeQuery(query) {
    return encodeURIComponent(query);
}
and it is work.  

my query didn't have any change .

so finally , i think maybe it is a borwser's problem...

thanks  Wolfgang
your answer also  useful for me.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open
LightInTheBox - Buy quality products at wholesale price