Bug 102523: Non-ASCII characters are showing up as '?'s in certain cases because the ASCII to UCS2 code which we recently started using more was doing an incorrect conversion. r=bbaetz, r=dbaron, rs=scc
git-svn-id: svn://10.0.0.236/trunk@104413 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -120,6 +120,8 @@ class LossyConvertEncoding
|
||||
typedef FromCharT input_type;
|
||||
typedef ToCharT output_type;
|
||||
|
||||
typedef nsCharTraits<FromCharT>::unsigned_char_type unsigned_input_type;
|
||||
|
||||
public:
|
||||
LossyConvertEncoding( output_type* aDestination ) : mDestination(aDestination) { }
|
||||
|
||||
@@ -128,7 +130,7 @@ class LossyConvertEncoding
|
||||
{
|
||||
const input_type* done_writing = aSource + aSourceLength;
|
||||
while ( aSource < done_writing )
|
||||
*mDestination++ = (output_type)(*aSource++); // use old-style cast to mimic old |ns[C]String| behavior
|
||||
*mDestination++ = (output_type)(unsigned_input_type)(*aSource++); // use old-style cast to mimic old |ns[C]String| behavior
|
||||
return aSourceLength;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user