Exemplo n.º 1
0
void
AppendUTF8toUTF16(const nsACString& aSource, nsAString& aDest)
{
  if (!AppendUTF8toUTF16(aSource, aDest, mozilla::fallible)) {
    aDest.AllocFailed(aDest.Length() + aSource.Length());
  }
}
Exemplo n.º 2
0
void
CopyASCIItoUTF16(const nsACString& aSource, nsAString& aDest)
{
  if (!CopyASCIItoUTF16(aSource, aDest, mozilla::fallible)) {
    // Note that this may wildly underestimate the allocation that failed, as
    // we report the length of aSource as UTF-16 instead of UTF-8.
    aDest.AllocFailed(aDest.Length() + aSource.Length());
  }
}