Replace zero width space

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Replace zero width space

exist-open mailing list
Hi All,

Can anyone help me here. How do I remove '%u200B'  from a string in XQuery.

Thanks in advance,
Roy





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Replace zero width space

Hungerburg
Am 2017-06-23 um 08:26 schrieb Roy Walter via Exist-open:
> Hi All,
>
> Can anyone help me here. How do I remove '%u200B'  from a string in XQuery.
>

In my install, this works in eXide's eval:

> let $input := 'zero​width​spaces'
> return (replace($input, "​", " "))

The ZWSP even shows as a red dot. The encoded works too:

> let $input := 'zero%u200Bwidth%u200Bspaces'
> return (replace($input, "%u200B", " "))

Seems trivial?

--
Peter

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Replace zero width space

exist-open mailing list
It does seem trivial. I had tried a simple replace but it didn't work with my source.

I'll try some more.

Thanks,
R.


---- On Fri, 23 Jun 2017 08:36:03 +0100 Hungerburg <[hidden email]> wrote ----

Am 2017-06-23 um 08:26 schrieb Roy Walter via Exist-open:
> Hi All,
>
> Can anyone help me here. How do I remove '%u200B' from a string in XQuery.
>

In my install, this works in eXide's eval:

> let $input := 'zero​width​spaces'
> return (replace($input, "​", " "))

The ZWSP even shows as a red dot. The encoded works too:

> let $input := 'zero%u200Bwidth%u200Bspaces'
> return (replace($input, "%u200B", " "))

Seems trivial?

--
Peter

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Replace zero width space

Peter Stadler
In reply to this post by Hungerburg
Hi,

I don’t think the %u-notation will work, but you can enter special characters by their codepoints like &#200B;,
so replace($input, '&#x200B;', ‚') should do the trick.

Best
Peter

> Am 23.06.2017 um 09:36 schrieb Hungerburg <[hidden email]>:
>
> Am 2017-06-23 um 08:26 schrieb Roy Walter via Exist-open:
>> Hi All,
>> Can anyone help me here. How do I remove '%u200B'  from a string in XQuery.
>
> In my install, this works in eXide's eval:
>
>> let $input := 'zero​width​spaces'
>> return (replace($input, "​", " "))
>
> The ZWSP even shows as a red dot. The encoded works too:
>
>> let $input := 'zero%u200Bwidth%u200Bspaces'
>> return (replace($input, "%u200B", " "))
>
> Seems trivial?
>
> --
> Peter
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
--
Peter Stadler
Carl-Maria-von-Weber-Gesamtausgabe
Arbeitsstelle Detmold
Hornsche Str. 39
D-32756 Detmold
Tel. +49 5231 975-676
Fax: +49 5231 975-668
stadler at weber-gesamtausgabe.de
www.weber-gesamtausgabe.de


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open

signature.asc (465 bytes) Download Attachment