[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Unicode question

Subject: Re: Unicode question
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 23 May 2018 17:57:51 -0000
Re:  Unicode question
Your variable contains a single Unicode character, 128540, Face with Stuck-Out
Tongue and Winking Eye. In some Unicode encodings the character will be
encoded as a surrogate pair. But XSLT sees only characters, not encodings, so
you have no way of finding out what encoding is being used or accessing the
octets that are used in that encoding.

Michael Kay
Saxonica

> On 23 May 2018, at 18:41, Erik Siegel erik@xxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hi out there,
>
> I have a problem that is Unicode related. Some Unicode characters (for
instance emojis) can have some code *following* the actual character to
indicate a variant. For instance in the following stylesheet, the emoji
character in $x (U+1F61C) is followed by U+DE1C. When I look in oXygen it
shows me this. But when I run the stylesheet it reports a string length of 1
and only a single codepoint.
>
> I suppose that is true, it is only  single character. But how can I find out
(in XPath) what the value of the second bcharacterb (indicator?) is? Or is
that impossible anyway?
>
> Thanks,
> Erik Siegel
>
> PS Running this in the latest oXygen using Saxon 9.8.
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform
<http://www.w3.org/1999/XSL/Transform>"
xmlns:xs="http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema>"
expand-text="true">
>
>   <xsl:template match="/">
>     <xsl:variable name="x" as="xs:string" select="'p'"/>
>     <test length="{string-length($x)}">{ string-to-codepoints($x) }</test>
>   </xsl:template>
>
> </xsl:stylesheet>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <-list/293509> (by email <>)

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.