Commits on Jun 21, 2021

  1. utils: Don't strip modifiers when stripping encoding

    We have some locales which are dupes if we do this, for example
    ca_ES.UTF-8 and ca_ES.UTF-8@valencia. The latter of these should become
    ca_ES@valencia in the output. That is what `locale -a` shows.
    
    Previously `as_locale_strip_encoding ()` modified the passed-in string
    in place. However, in the one place where don't `g_strdup ()` the string
    before passing to this function, it is the key in a `GHashTable`. We
    can't do this, and only get away with it because the hash table isn't
    touched after this call. Fix the function to instead return a newly
    allocated string, and drop the `g_strdup` calls from the other call
    sites.
    
    Add a small test for this function too.
    
    ximion/appstream-generator#92
    Iain Lane committed Jun 21, 2021
  2. utils: Replace as_gstring_replace definition with upstream's

    Until we can depend on 2.68, it's probably best to standardise on one
    implementation - also, this one is much simpler.
    Iain Lane committed Jun 21, 2021