NS_LossyConvertUCS2toASCII()

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

NS_LossyConvertUCS2toASCII()

Kulkarni Jeet
I am trying to understand what the following function does in the mozilla code.
NS_LossyConvertUCS2toASCII().

Could anyone let me know what does this function exactly do?
Also if anyone could let me know the source code of this function, that would be great?


Thanks in advance,
Jeet Kulkarni.
Reply | Threaded
Open this post in threaded view
|

Re: NS_LossyConvertUCS2toASCII()

Boris Zbarsky
Kulkarni Jeet wrote:
> I am trying to understand what the following function does in the mozilla
> code.
> NS_LossyConvertUCS2toASCII().

What it says: converts an nsAString to an nsACString by assuming that all the
16-bit units are ASCII and just dropping the high byte on them all.

> Also if anyone could let me know the source code of this function, that
> would be great?

There's a bunch of indirection, then you get to
http://lxr.mozilla.org/seamonkey/source/xpcom/string/src/nsReadableUtils.cpp#114

-Boris

_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: NS_LossyConvertUCS2toASCII()

jeet kulkarni
I tried to investigate through the source code pointed out by you, but could not quite figure out where the conversion takes place.

- Jeet
Boris Zbarsky wrote
Kulkarni Jeet wrote:
> I am trying to understand what the following function does in the mozilla
> code.
> NS_LossyConvertUCS2toASCII().

What it says: converts an nsAString to an nsACString by assuming that all the
16-bit units are ASCII and just dropping the high byte on them all.

> Also if anyone could let me know the source code of this function, that
> would be great?

There's a bunch of indirection, then you get to
http://lxr.mozilla.org/seamonkey/source/xpcom/string/src/nsReadableUtils.cpp#114

-Boris

_______________________________________________
dev-tech-layout mailing list
dev-tech-layout@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: NS_LossyConvertUCS2toASCII()

Boris Zbarsky
In reply to this post by Boris Zbarsky
jeet kulkarni wrote:
> I tried to investigate through the source code pointed out by you, but could
> not quite figure out where the conversion takes place.

http://lxr.mozilla.org/seamonkey/source/xpcom/string/public/nsUTF8Utils.h#725

-Boris
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout