-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I have a xpcom C++ component whose main method is

NS_IMETHODIMP nsMyComp::Read(const nsACString & aStr, const nsACString &
aContent, const nsACString & aPriority)

my idl is:

void read(in ACString str, in ACString content, in ACString priority);

this works fine on some computer (debian unstable, xulrunner 1.8.1), but it does
not work on some other computers (same os, same xulrunner version).

I call this method from javascript with comp.read("claire");

On computer where everything works fine, aStr is utf8.

On computer where it does not work, it seems that aStr (and also aContent and
aPiority) are transformed to utf16.

for debugging purpose, I tried that piece of code:

  const char* start = aStr.BeginReading();
  const char* end = aStr.EndReading();

  PRUint32 count = 0;
  int i = 0;
  while (start != end)
  {
      printf("%d: %c\n", i, *start);
      start++;
      i++;
  }

on the first computer, I get
c
l
a
i
r
e

on the second
c

l

a

i

r

e


so, one every other char is blank (that's the reason why I think it's utf16, but
I'm not totally sure)

Do you have any idea why there are different behaviours ?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGy/DLiH9aBScBsrMRAiukAJ4ouosqlHLNTzDBziSrQtouurNcUwCeP9Y5
PBxo8+6X7rdy3eOVd0asGkM=
=nnDi
-----END PGP SIGNATURE-----
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to