Mailinglist Archive: yast-devel (23 mails)

< Previous Next >
Re: [yast-devel] Re: YCP substring() Was: YCP String operator [] and UTF-8
On Tue, Apr 03, 2012 at 11:07:57AM +0200, Ladislav Slezak wrote:
Dne 3.4.2012 10:15, Klaus Kaempf napsal(a):

Ooops, I just realized that the problem is actually in substring() function,
[] operator works only with lists, maps or terms in YCP. (I'm using so many

I used substring() to get one character. So the problematic call is

substring("áa", 1, 1);

which returns "\0xF1" instead of "a" as I expected.

The documentation does not tell whether the substring() argument units are
bytes or characters.

YCP has the function lsubstring:

For many functions though there is no UTF-8 aware version,
e.g. search, tolower, deletechars, findfirstof, ...


Arvin Schnell, <aschnell@xxxxxxx>
Senior Software Engineer, Research & Development
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB
16746 (AG Nürnberg)
Maxfeldstraße 5
90409 Nürnberg
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >
List Navigation
Follow Ups