Dne 3.4.2012 09:37, Johannes Meixner napsal(a):
Could a YCP expert show the correct way (example code) how to remove an UTF8 sub-string from an UTF8 string? I.e. how to remove "Bar" from "FooBarBaz" in an UTF8-safe way?
More generally: Is there documentation how to work on UTF8 strings with YCP in general?
Um, it seems that the documentation does not mention the [] behavior for string (http://doc.opensuse.org/projects/YaST/openSUSE11.3/tdg/bracket.html nor http://doc.opensuse.org/projects/YaST/openSUSE11.3/tdg/id_ycp_data_string.ht...). I fixed that particular bug by using regexpsub() instead of iterating over the string and using [] operator. So I guess the regexp*() functions are UTF-8 safe. I'm not sure what the correct solution is. Maybe the correct way is to fix the [] operator after all... That's why I have opened this discussion, because maybe someone is relaying on the current "buggy" behavior... (I don't expect that but I'd like to avoid regressions if possible.) -- Best Regards Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org