Re: [basex-talk] Use of xs:hexBinary() comes with strange results

2019-06-11 Thread Michael Seiferle
Hi Andreas,

I think what you are observing is the following: 

UTF-8 encoded stings can optionally denote a multi-byte sequence, with the 
number of leading 1-s defining the multibyte pattern length.
c.f. https://en.wikipedia.org/wiki/UTF-8 

In your example, c3 decodes to: 
> xs:hexBinary("c3")
> => convert:binary-to-integers()
> => for-each(convert:integer-to-base(?,2))
> (: returns: 1111 :)
And the two leading 1s will tell the UTF-8 decoder to read a second byte — 
which is missing — hence decoding fails with an error or if you use the 
fallback-option it will return a �

While decoding ASCII, where only 127 bits are used, this is no problem as UTF-8 
shares the same character positions with the ascii table.

Your „C3“ character however is not in ascii but most probably ISO-8859-1 or 
CP1252? So while a glance at https://tools.ietf.org/html/rfc3986 
 says URI Characters should be encoded in 
UTF-8 in practice 
chances are you encounter values that are encoded using some „local“ encoding.

If your string is not UTF-8 encoded you may only guess what the correct 
encoding is.

You may send a predefined string that is known to be of two bytes length in 
UTF-8, such as: ä that will be either converted to „%C3%A4“  if it is unicode 
or to a well known single byte such as for example „E4“ in ISO-8859-1.
Depending and what you receive by your client for that given string you may 
assume it encodes its data either utf-8 or latin1. 

You can check what your string would be encoded to: 
> string(convert:string-to-hex('ä',"latin1")) 


Sorry for the long mail, hope the explanation is useful for you, even though 
the solution is not sooo simple and involves guessing :-)

Best
Michael 





> Am 09.06.2019 um 17:09 schrieb Andreas Mixich :
> 
> How can I simply get back any character, readable by a human, from a 
> hexadecimal value?
> 



[basex-talk] JS223 wrapper

2019-06-11 Thread Marco Lettere

Hi all,

is anyone on the list aware of a JS223 compliant wrapper for BaseX in 
order to include XQuery scripting "seamlessly" into scriptable applications?


Thanks.

Marco.



Re: [basex-talk] Health Analyzer registration issue

2019-06-11 Thread Michael Seiferle
Hi Ganesh, 

Sorry, but seems your email somehow got misdirected to us?
We’ll be glad to support your colleagues at VMware however I am not sure what 
caused this bug by just looking at your screenshot ;)

Best
Michael


> Am 11.06.2019 um 08:02 schrieb Ganesh Joshi Regmi (c) 
> :
> 
> Hi Team,
>  
> I am trying to register the VMware Health Analyser OVA with code that I 
> received after registering via my employee email. However, I am unable to 
> complete the registration with below error.
>  
> 
>  
> Can you please look at this and revert back with solution.
>  
>  
> Cheers,
> Ganesh
>  
> Ganesh Joshi Regmi | Senior PSO Consultant
> VCP-4,5,6 | VCP- NV | VCAP-NV | VCAP-DCA
> VMware Australia & New Zealand 
> +61 452 409 609 | gjoshire...@vmware.com   
>  
> Level 8 175 Pitt Street, Sydney NSW 2000
>  
>     
>  
> 
>  
>