Fixing part of bug 209699 (and more of bug 87677). Implement char* and PRUnichar* versions of Copy/AppendUTF*toUTF*(). r=alecf@flett.org, r=dbaron@dbaron.org, sr=jaggernaut@netscape.com
git-svn-id: svn://10.0.0.236/trunk@143925 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -192,6 +192,22 @@ CopyUTF8toUTF16( const nsACString& aSource, nsAString& aDest )
|
||||
AppendUTF8toUTF16(aSource, aDest);
|
||||
}
|
||||
|
||||
NS_COM
|
||||
void
|
||||
CopyUTF16toUTF8( const PRUnichar* aSource, nsACString& aDest )
|
||||
{
|
||||
aDest.Truncate();
|
||||
AppendUTF16toUTF8(aSource, aDest);
|
||||
}
|
||||
|
||||
NS_COM
|
||||
void
|
||||
CopyUTF8toUTF16( const char* aSource, nsAString& aDest )
|
||||
{
|
||||
aDest.Truncate();
|
||||
AppendUTF8toUTF16(aSource, aDest);
|
||||
}
|
||||
|
||||
NS_COM
|
||||
void
|
||||
AppendUTF16toUTF8( const nsAString& aSource, nsACString& aDest )
|
||||
@@ -301,6 +317,24 @@ AppendUTF8toUTF16( const nsACString& aSource, nsAString& aDest )
|
||||
}
|
||||
}
|
||||
|
||||
NS_COM
|
||||
void
|
||||
AppendUTF16toUTF8( const PRUnichar* aSource, nsACString& aDest )
|
||||
{
|
||||
if (aSource) {
|
||||
AppendUTF16toUTF8(nsDependentString(aSource), aDest);
|
||||
}
|
||||
}
|
||||
|
||||
NS_COM
|
||||
void
|
||||
AppendUTF8toUTF16( const char* aSource, nsAString& aDest )
|
||||
{
|
||||
if (aSource) {
|
||||
AppendUTF8toUTF16(nsDependentCString(aSource), aDest);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A helper function that allocates a buffer of the desired character type big enough to hold a copy of the supplied string (plus a zero terminator).
|
||||
|
||||
Reference in New Issue
Block a user