Mailinglist Archive: yast-devel (23 mails)

< Previous Next >
Re: [yast-devel] YCP String operator [] and UTF-8
On Thu, Apr 05, 2012 at 11:02:35AM +0200, Josef Reidinger wrote:

I still think that main problem is that we want unicode strings in
YaST, but we use in backend string. I think that now it is right time
to try to switch string implementation to wstring and be ready to such
change. I can create set of patches if someone is interested in it and
test it.

I also had a look at this. But changing the main member variable
of YCPString from std::string to std::wstring is not trivial
possible since the function value_cstr exposes it and that
function is used not only in yast2-core. I also noticed that
glibc does not provide regex functions for wchar_t. Here we would
have to use boost adding a dependencies on libboost_regex.

So maybe just fixing the few builtins is easier. My idea is to
use std::string operations when the YCPStrings are ASCII,
std::wstring otherwise. I checked how many YCPString are used and
how many of these are non-ascii: Starting yast2 storage (in
german locale) constructs about 15000 YCPStrings of which only
400 are non-ascii (almost all help texts). So the idea seems

You can find a patch in
~aschnell/Export/yast2-core-utf8.1.diff. Be aware that it changes
to ABI of libycp, so you have to recompile a lot of stuff.



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