Renaming sal_Unicode to a less misleading name?

Stephan Bergmann sbergman at
Mon Feb 15 08:30:27 UTC 2016

On 02/13/2016 04:21 PM, Norbert Thiebaud wrote:
> On Sat, Feb 13, 2016 at 6:17 AM, Khaled Hosny <khaledhosny at> wrote:
>> I count only ~7000 usages across the code base, so that is not such a
>> huge task.
> Internally it is doable, externally that is more of a problem, since
> sal_Unicode is part of the stable external API.
> The best you can do is to have an internal 'alias' for it.

Or the worst, considering that you then confusingly have two names for 
the same concept.

> It may be indeed useful, for more clarity, to have typedef to be
> explicit about things, sal_utf8, sal_utf16, sal_utf16be, sal_utf16le,
> sal_utf32, sal_utf32be, sal_utf32le

Trying to encode semantic differences (like between sal_utf16be and 
sal_utf16le) requires discipline (as it does not get any aid from the 
compiler's type checking), and when it starts to go sour it's probably 
worse than not trying to make the distinction in the type system in the 
first place (as now variables labelled to be of type sal_utf16be will 
misleadingly contain values of type sal_utf16le).

More information about the LibreOffice mailing list