You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2018/05/27 20:29:14 UTC

[royale-asjs] branch develop updated: fix latest commit, since binary data to string method was not really working

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 028a26a  fix latest commit, since binary data to string method was not really working
028a26a is described below

commit 028a26ad29aac3740f150f9b971e310731a69db9
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun May 27 22:28:57 2018 +0200

    fix latest commit, since binary data to string method was not really working
---
 .../Core/src/main/royale/org/apache/royale/utils/BinaryData.as        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
index 0aa3097..5500c8f 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
@@ -213,7 +213,7 @@ public class BinaryData implements IBinaryDataInput, IBinaryDataOutput
 
         COMPILE::JS
         {
-            return String.fromCharCode.apply(null, new Uint16Array(ba));
+            return (new TextDecoder("utf-8")).decode(ba);
         }
 	}
 
@@ -804,7 +804,7 @@ public class BinaryData implements IBinaryDataInput, IBinaryDataOutput
         }
         COMPILE::JS
         {
-            return _len;;
+            return _len;
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
carlosrovira@apache.org.

Re: [royale-asjs] branch develop updated: fix latest commit, since binary data to string method was not really working

Posted by Carlos Rovira <ca...@apache.org>.
Hi Harbs,

I just check it and all seems to work ok :)

2018-06-11 13:30 GMT+02:00 Carlos Rovira <ca...@apache.org>:

>
>
> 2018-06-11 13:26 GMT+02:00 Harbs <ha...@gmail.com>:
>
>> I changed toString() to be a pointer to readUTFBytes.
>>
>
> ok, I'll check if it works for UID generation as I can
>
>
>>
>> Uint16Array will not work for UTF8. It might work for UTF16. Not sure. It
>> might be interesting to see if the String.fromCharCode.apply approach would
>> work with Uint8Array. If yes, the readUTFBtyes method could possibly be
>> simplified.
>>
>> I’m not sure what the value of having a toString method is. Is that
>> something needed for AMF?
>>
>
> Yes, it's used on UID generation.
>
>
>>
>> Harbs
>>
>> > On Jun 11, 2018, at 2:17 PM, Carlos Rovira <ca...@apache.org>
>> wrote:
>> >
>> > Hi Harbs,
>> >
>> > see my fix, and if you think is not ok, feel free to update as you
>> think.
>> > Then I can try AMF generation of UID and see if it continues working
>> right
>> > ok?
>> >
>> > I think with my latest commit I revert to how this was working...if I'm
>> not
>> > missing something
>> >
>> > thanks
>> >
>> >
>> >
>> >
>> > 2018-06-11 13:14 GMT+02:00 Harbs <harbs.lists@gmail.com <mailto:
>> harbs.lists@gmail.com>>:
>> >
>> >> Why do you need toString rather than readUTFBytes()? FWIW,
>> readUTFBytes()
>> >> already falls back to TextDecoder when available.
>> >>
>> >>> On Jun 11, 2018, at 2:07 PM, Carlos Rovira <ca...@apache.org>
>> >> wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> no problem, we can go back to how it was that line before. I changed
>> it
>> >> be
>> >>> have the same in all that class, but wasn't aware of that problem.
>> >>> So I'll change to what we had, and make to String do the same. I
>> think it
>> >>> should work the same and as well work on IE/Edge
>> >>>
>> >>> I'll take a look right now
>> >>>
>> >>> 2018-06-11 11:13 GMT+02:00 Harbs <harbs.lists@gmail.com <mailto:
>> harbs.lists@gmail.com> <mailto:
>> >> harbs.lists@gmail.com <ma...@gmail.com>>>:
>> >>>
>> >>>> FWIW, I always check web API support in MDN and caniuse.com <
>> http://caniuse.com/> before
>> >> using
>> >>>> them in Royale.
>> >>>>
>> >>>> Some more details win this specific issue:
>> >>>>
>> >>>> It looks like you added toString() to BinaryData and changed
>> UIDUtils to
>> >>>> use that.
>> >>>>
>> >>>> I don’t think a toString method in BinaryData makes sense. Flash was
>> >> very
>> >>>> smart about how it converted to a string. It was able to use the
>> system
>> >>>> encoding if available. etc.
>> >>>>
>> >>>> Trying to emulate that kind of behavior in BinaryData is not going
>> to be
>> >>>> very PAYG. BinaryData already has UTF methods which cover the vast
>> >> majority
>> >>>> of text needs with BinaryData. Other types of text conversions
>> should be
>> >>>> handled using utility functions if needed.
>> >>>>
>> >>>> There are ways to get cross-browser support similar to TextEncoder,
>> but
>> >>>> it’s not very PAYG either.[1]
>> >>>>
>> >>>> My $0.02,
>> >>>> Harbs
>> >>>>
>> >>>> [1]https://stackoverflow.com/questions/6965107/converting- <
>> https://stackoverflow.com/questions/6965107/converting->
>> >>>> between-strings-and-arraybuffers <https://stackoverflow.com/ <
>> https://stackoverflow.com/> <
>> >> https://stackoverflow.com/>
>> >>>> questions/6965107/converting-between-strings-and-arraybuffers>
>> >>>>> On Jun 11, 2018, at 12:02 PM, Yishay Weiss <yi...@hotmail.com>
>> >>>> wrote:
>> >>>>>
>> >>>>> Carols,
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> This breaks our app on IE and Edge, as they don’t support
>> TextDecoder.
>> >>>> Can you fix this?
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> ________________________________
>> >>>>> From: carlosrovira@apache.org <ca...@apache.org>
>> >>>>> Sent: Sunday, May 27, 2018 11:29:14 PM
>> >>>>> To: commits@royale.apache.org
>> >>>>> Subject: [royale-asjs] branch develop updated: fix latest commit,
>> since
>> >>>> binary data to string method was not really working
>> >>>>>
>> >>>>> This is an automated email from the ASF dual-hosted git repository.
>> >>>>>
>> >>>>> carlosrovira pushed a commit to branch develop
>> >>>>> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>> >>>>>
>> >>>>>
>> >>>>> The following commit(s) were added to refs/heads/develop by this
>> push:
>> >>>>>   new 028a26a  fix latest commit, since binary data to string method
>> >>>> was not really working
>> >>>>> 028a26a is described below
>> >>>>>
>> >>>>> commit 028a26ad29aac3740f150f9b971e310731a69db9
>> >>>>> Author: Carlos Rovira <ca...@apache.org>
>> >>>>> AuthorDate: Sun May 27 22:28:57 2018 +0200
>> >>>>>
>> >>>>>  fix latest commit, since binary data to string method was not
>> really
>> >>>> working
>> >>>>> ---
>> >>>>> .../Core/src/main/royale/org/apache/royale/utils/BinaryData.as
>> >> |
>> >>>> 4 ++--
>> >>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>> >>>>>
>> >>>>> diff --git a/frameworks/projects/Core/src/main/royale/org/apache/
>> >> royale/utils/BinaryData.as
>> >>>> b/frameworks/projects/Core/src/main/royale/org/apache/
>> >>>> royale/utils/BinaryData.as
>> >>>>> index 0aa3097..5500c8f 100644
>> >>>>> --- a/frameworks/projects/Core/src/main/royale/org/apache/
>> >>>> royale/utils/BinaryData.as
>> >>>>> +++ b/frameworks/projects/Core/src/main/royale/org/apache/
>> >>>> royale/utils/BinaryData.as
>> >>>>> @@ -213,7 +213,7 @@ public class BinaryData implements
>> >> IBinaryDataInput,
>> >>>> IBinaryDataOutput
>> >>>>>
>> >>>>>       COMPILE::JS
>> >>>>>       {
>> >>>>> -            return String.fromCharCode.apply(null, new
>> >>>> Uint16Array(ba));
>> >>>>> +            return (new TextDecoder("utf-8")).decode(ba);
>> >>>>>       }
>> >>>>>       }
>> >>>>>
>> >>>>> @@ -804,7 +804,7 @@ public class BinaryData implements
>> >> IBinaryDataInput,
>> >>>> IBinaryDataOutput
>> >>>>>       }
>> >>>>>       COMPILE::JS
>> >>>>>       {
>> >>>>> -            return _len;;
>> >>>>> +            return _len;
>> >>>>>       }
>> >>>>>   }
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> To stop receiving notification emails like this one, please contact
>> >>>>> carlosrovira@apache.org.
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>> --
>> >>> Carlos Rovira
>> >>> http://about.me/carlosrovira <http://about.me/carlosrovira> <
>> http://about.me/carlosrovira <http://about.me/carlosrovira>>
>> >>
>> >
>> >
>> >
>> > --
>> > Carlos Rovira
>> > http://about.me/carlosrovira <http://about.me/carlosrovira>
>>
>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch develop updated: fix latest commit, since binary data to string method was not really working

Posted by Carlos Rovira <ca...@apache.org>.
2018-06-11 13:26 GMT+02:00 Harbs <ha...@gmail.com>:

> I changed toString() to be a pointer to readUTFBytes.
>

ok, I'll check if it works for UID generation as I can


>
> Uint16Array will not work for UTF8. It might work for UTF16. Not sure. It
> might be interesting to see if the String.fromCharCode.apply approach would
> work with Uint8Array. If yes, the readUTFBtyes method could possibly be
> simplified.
>
> I’m not sure what the value of having a toString method is. Is that
> something needed for AMF?
>

Yes, it's used on UID generation.


>
> Harbs
>
> > On Jun 11, 2018, at 2:17 PM, Carlos Rovira <ca...@apache.org>
> wrote:
> >
> > Hi Harbs,
> >
> > see my fix, and if you think is not ok, feel free to update as you think.
> > Then I can try AMF generation of UID and see if it continues working
> right
> > ok?
> >
> > I think with my latest commit I revert to how this was working...if I'm
> not
> > missing something
> >
> > thanks
> >
> >
> >
> >
> > 2018-06-11 13:14 GMT+02:00 Harbs <harbs.lists@gmail.com <mailto:
> harbs.lists@gmail.com>>:
> >
> >> Why do you need toString rather than readUTFBytes()? FWIW,
> readUTFBytes()
> >> already falls back to TextDecoder when available.
> >>
> >>> On Jun 11, 2018, at 2:07 PM, Carlos Rovira <ca...@apache.org>
> >> wrote:
> >>>
> >>> Hi,
> >>>
> >>> no problem, we can go back to how it was that line before. I changed it
> >> be
> >>> have the same in all that class, but wasn't aware of that problem.
> >>> So I'll change to what we had, and make to String do the same. I think
> it
> >>> should work the same and as well work on IE/Edge
> >>>
> >>> I'll take a look right now
> >>>
> >>> 2018-06-11 11:13 GMT+02:00 Harbs <harbs.lists@gmail.com <mailto:
> harbs.lists@gmail.com> <mailto:
> >> harbs.lists@gmail.com <ma...@gmail.com>>>:
> >>>
> >>>> FWIW, I always check web API support in MDN and caniuse.com <
> http://caniuse.com/> before
> >> using
> >>>> them in Royale.
> >>>>
> >>>> Some more details win this specific issue:
> >>>>
> >>>> It looks like you added toString() to BinaryData and changed UIDUtils
> to
> >>>> use that.
> >>>>
> >>>> I don’t think a toString method in BinaryData makes sense. Flash was
> >> very
> >>>> smart about how it converted to a string. It was able to use the
> system
> >>>> encoding if available. etc.
> >>>>
> >>>> Trying to emulate that kind of behavior in BinaryData is not going to
> be
> >>>> very PAYG. BinaryData already has UTF methods which cover the vast
> >> majority
> >>>> of text needs with BinaryData. Other types of text conversions should
> be
> >>>> handled using utility functions if needed.
> >>>>
> >>>> There are ways to get cross-browser support similar to TextEncoder,
> but
> >>>> it’s not very PAYG either.[1]
> >>>>
> >>>> My $0.02,
> >>>> Harbs
> >>>>
> >>>> [1]https://stackoverflow.com/questions/6965107/converting- <
> https://stackoverflow.com/questions/6965107/converting->
> >>>> between-strings-and-arraybuffers <https://stackoverflow.com/ <
> https://stackoverflow.com/> <
> >> https://stackoverflow.com/>
> >>>> questions/6965107/converting-between-strings-and-arraybuffers>
> >>>>> On Jun 11, 2018, at 12:02 PM, Yishay Weiss <yi...@hotmail.com>
> >>>> wrote:
> >>>>>
> >>>>> Carols,
> >>>>>
> >>>>>
> >>>>>
> >>>>> This breaks our app on IE and Edge, as they don’t support
> TextDecoder.
> >>>> Can you fix this?
> >>>>>
> >>>>>
> >>>>>
> >>>>> ________________________________
> >>>>> From: carlosrovira@apache.org <ca...@apache.org>
> >>>>> Sent: Sunday, May 27, 2018 11:29:14 PM
> >>>>> To: commits@royale.apache.org
> >>>>> Subject: [royale-asjs] branch develop updated: fix latest commit,
> since
> >>>> binary data to string method was not really working
> >>>>>
> >>>>> This is an automated email from the ASF dual-hosted git repository.
> >>>>>
> >>>>> carlosrovira pushed a commit to branch develop
> >>>>> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
> >>>>>
> >>>>>
> >>>>> The following commit(s) were added to refs/heads/develop by this
> push:
> >>>>>   new 028a26a  fix latest commit, since binary data to string method
> >>>> was not really working
> >>>>> 028a26a is described below
> >>>>>
> >>>>> commit 028a26ad29aac3740f150f9b971e310731a69db9
> >>>>> Author: Carlos Rovira <ca...@apache.org>
> >>>>> AuthorDate: Sun May 27 22:28:57 2018 +0200
> >>>>>
> >>>>>  fix latest commit, since binary data to string method was not really
> >>>> working
> >>>>> ---
> >>>>> .../Core/src/main/royale/org/apache/royale/utils/BinaryData.as
> >> |
> >>>> 4 ++--
> >>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
> >>>>>
> >>>>> diff --git a/frameworks/projects/Core/src/main/royale/org/apache/
> >> royale/utils/BinaryData.as
> >>>> b/frameworks/projects/Core/src/main/royale/org/apache/
> >>>> royale/utils/BinaryData.as
> >>>>> index 0aa3097..5500c8f 100644
> >>>>> --- a/frameworks/projects/Core/src/main/royale/org/apache/
> >>>> royale/utils/BinaryData.as
> >>>>> +++ b/frameworks/projects/Core/src/main/royale/org/apache/
> >>>> royale/utils/BinaryData.as
> >>>>> @@ -213,7 +213,7 @@ public class BinaryData implements
> >> IBinaryDataInput,
> >>>> IBinaryDataOutput
> >>>>>
> >>>>>       COMPILE::JS
> >>>>>       {
> >>>>> -            return String.fromCharCode.apply(null, new
> >>>> Uint16Array(ba));
> >>>>> +            return (new TextDecoder("utf-8")).decode(ba);
> >>>>>       }
> >>>>>       }
> >>>>>
> >>>>> @@ -804,7 +804,7 @@ public class BinaryData implements
> >> IBinaryDataInput,
> >>>> IBinaryDataOutput
> >>>>>       }
> >>>>>       COMPILE::JS
> >>>>>       {
> >>>>> -            return _len;;
> >>>>> +            return _len;
> >>>>>       }
> >>>>>   }
> >>>>>
> >>>>>
> >>>>> --
> >>>>> To stop receiving notification emails like this one, please contact
> >>>>> carlosrovira@apache.org.
> >>>>
> >>>>
> >>>
> >>>
> >>> --
> >>> Carlos Rovira
> >>> http://about.me/carlosrovira <http://about.me/carlosrovira> <
> http://about.me/carlosrovira <http://about.me/carlosrovira>>
> >>
> >
> >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira <http://about.me/carlosrovira>
>



-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch develop updated: fix latest commit, since binary data to string method was not really working

Posted by Harbs <ha...@gmail.com>.
I changed toString() to be a pointer to readUTFBytes.

Uint16Array will not work for UTF8. It might work for UTF16. Not sure. It might be interesting to see if the String.fromCharCode.apply approach would work with Uint8Array. If yes, the readUTFBtyes method could possibly be simplified.

I’m not sure what the value of having a toString method is. Is that something needed for AMF?

Harbs

> On Jun 11, 2018, at 2:17 PM, Carlos Rovira <ca...@apache.org> wrote:
> 
> Hi Harbs,
> 
> see my fix, and if you think is not ok, feel free to update as you think.
> Then I can try AMF generation of UID and see if it continues working right
> ok?
> 
> I think with my latest commit I revert to how this was working...if I'm not
> missing something
> 
> thanks
> 
> 
> 
> 
> 2018-06-11 13:14 GMT+02:00 Harbs <harbs.lists@gmail.com <ma...@gmail.com>>:
> 
>> Why do you need toString rather than readUTFBytes()? FWIW, readUTFBytes()
>> already falls back to TextDecoder when available.
>> 
>>> On Jun 11, 2018, at 2:07 PM, Carlos Rovira <ca...@apache.org>
>> wrote:
>>> 
>>> Hi,
>>> 
>>> no problem, we can go back to how it was that line before. I changed it
>> be
>>> have the same in all that class, but wasn't aware of that problem.
>>> So I'll change to what we had, and make to String do the same. I think it
>>> should work the same and as well work on IE/Edge
>>> 
>>> I'll take a look right now
>>> 
>>> 2018-06-11 11:13 GMT+02:00 Harbs <harbs.lists@gmail.com <ma...@gmail.com> <mailto:
>> harbs.lists@gmail.com <ma...@gmail.com>>>:
>>> 
>>>> FWIW, I always check web API support in MDN and caniuse.com <http://caniuse.com/> before
>> using
>>>> them in Royale.
>>>> 
>>>> Some more details win this specific issue:
>>>> 
>>>> It looks like you added toString() to BinaryData and changed UIDUtils to
>>>> use that.
>>>> 
>>>> I don’t think a toString method in BinaryData makes sense. Flash was
>> very
>>>> smart about how it converted to a string. It was able to use the system
>>>> encoding if available. etc.
>>>> 
>>>> Trying to emulate that kind of behavior in BinaryData is not going to be
>>>> very PAYG. BinaryData already has UTF methods which cover the vast
>> majority
>>>> of text needs with BinaryData. Other types of text conversions should be
>>>> handled using utility functions if needed.
>>>> 
>>>> There are ways to get cross-browser support similar to TextEncoder, but
>>>> it’s not very PAYG either.[1]
>>>> 
>>>> My $0.02,
>>>> Harbs
>>>> 
>>>> [1]https://stackoverflow.com/questions/6965107/converting- <https://stackoverflow.com/questions/6965107/converting->
>>>> between-strings-and-arraybuffers <https://stackoverflow.com/ <https://stackoverflow.com/> <
>> https://stackoverflow.com/>
>>>> questions/6965107/converting-between-strings-and-arraybuffers>
>>>>> On Jun 11, 2018, at 12:02 PM, Yishay Weiss <yi...@hotmail.com>
>>>> wrote:
>>>>> 
>>>>> Carols,
>>>>> 
>>>>> 
>>>>> 
>>>>> This breaks our app on IE and Edge, as they don’t support TextDecoder.
>>>> Can you fix this?
>>>>> 
>>>>> 
>>>>> 
>>>>> ________________________________
>>>>> From: carlosrovira@apache.org <ca...@apache.org>
>>>>> Sent: Sunday, May 27, 2018 11:29:14 PM
>>>>> To: commits@royale.apache.org
>>>>> Subject: [royale-asjs] branch develop updated: fix latest commit, since
>>>> binary data to string method was not really working
>>>>> 
>>>>> This is an automated email from the ASF dual-hosted git repository.
>>>>> 
>>>>> carlosrovira pushed a commit to branch develop
>>>>> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>>>>> 
>>>>> 
>>>>> The following commit(s) were added to refs/heads/develop by this push:
>>>>>   new 028a26a  fix latest commit, since binary data to string method
>>>> was not really working
>>>>> 028a26a is described below
>>>>> 
>>>>> commit 028a26ad29aac3740f150f9b971e310731a69db9
>>>>> Author: Carlos Rovira <ca...@apache.org>
>>>>> AuthorDate: Sun May 27 22:28:57 2018 +0200
>>>>> 
>>>>>  fix latest commit, since binary data to string method was not really
>>>> working
>>>>> ---
>>>>> .../Core/src/main/royale/org/apache/royale/utils/BinaryData.as
>> |
>>>> 4 ++--
>>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>>> 
>>>>> diff --git a/frameworks/projects/Core/src/main/royale/org/apache/
>> royale/utils/BinaryData.as
>>>> b/frameworks/projects/Core/src/main/royale/org/apache/
>>>> royale/utils/BinaryData.as
>>>>> index 0aa3097..5500c8f 100644
>>>>> --- a/frameworks/projects/Core/src/main/royale/org/apache/
>>>> royale/utils/BinaryData.as
>>>>> +++ b/frameworks/projects/Core/src/main/royale/org/apache/
>>>> royale/utils/BinaryData.as
>>>>> @@ -213,7 +213,7 @@ public class BinaryData implements
>> IBinaryDataInput,
>>>> IBinaryDataOutput
>>>>> 
>>>>>       COMPILE::JS
>>>>>       {
>>>>> -            return String.fromCharCode.apply(null, new
>>>> Uint16Array(ba));
>>>>> +            return (new TextDecoder("utf-8")).decode(ba);
>>>>>       }
>>>>>       }
>>>>> 
>>>>> @@ -804,7 +804,7 @@ public class BinaryData implements
>> IBinaryDataInput,
>>>> IBinaryDataOutput
>>>>>       }
>>>>>       COMPILE::JS
>>>>>       {
>>>>> -            return _len;;
>>>>> +            return _len;
>>>>>       }
>>>>>   }
>>>>> 
>>>>> 
>>>>> --
>>>>> To stop receiving notification emails like this one, please contact
>>>>> carlosrovira@apache.org.
>>>> 
>>>> 
>>> 
>>> 
>>> --
>>> Carlos Rovira
>>> http://about.me/carlosrovira <http://about.me/carlosrovira> <http://about.me/carlosrovira <http://about.me/carlosrovira>>
>> 
> 
> 
> 
> -- 
> Carlos Rovira
> http://about.me/carlosrovira <http://about.me/carlosrovira>

Re: [royale-asjs] branch develop updated: fix latest commit, since binary data to string method was not really working

Posted by Carlos Rovira <ca...@apache.org>.
Hi Harbs,

see my fix, and if you think is not ok, feel free to update as you think.
Then I can try AMF generation of UID and see if it continues working right
ok?

I think with my latest commit I revert to how this was working...if I'm not
missing something

thanks




2018-06-11 13:14 GMT+02:00 Harbs <ha...@gmail.com>:

> Why do you need toString rather than readUTFBytes()? FWIW, readUTFBytes()
> already falls back to TextDecoder when available.
>
> > On Jun 11, 2018, at 2:07 PM, Carlos Rovira <ca...@apache.org>
> wrote:
> >
> > Hi,
> >
> > no problem, we can go back to how it was that line before. I changed it
> be
> > have the same in all that class, but wasn't aware of that problem.
> > So I'll change to what we had, and make to String do the same. I think it
> > should work the same and as well work on IE/Edge
> >
> > I'll take a look right now
> >
> > 2018-06-11 11:13 GMT+02:00 Harbs <harbs.lists@gmail.com <mailto:
> harbs.lists@gmail.com>>:
> >
> >> FWIW, I always check web API support in MDN and caniuse.com before
> using
> >> them in Royale.
> >>
> >> Some more details win this specific issue:
> >>
> >> It looks like you added toString() to BinaryData and changed UIDUtils to
> >> use that.
> >>
> >> I don’t think a toString method in BinaryData makes sense. Flash was
> very
> >> smart about how it converted to a string. It was able to use the system
> >> encoding if available. etc.
> >>
> >> Trying to emulate that kind of behavior in BinaryData is not going to be
> >> very PAYG. BinaryData already has UTF methods which cover the vast
> majority
> >> of text needs with BinaryData. Other types of text conversions should be
> >> handled using utility functions if needed.
> >>
> >> There are ways to get cross-browser support similar to TextEncoder, but
> >> it’s not very PAYG either.[1]
> >>
> >> My $0.02,
> >> Harbs
> >>
> >> [1]https://stackoverflow.com/questions/6965107/converting-
> >> between-strings-and-arraybuffers <https://stackoverflow.com/ <
> https://stackoverflow.com/>
> >> questions/6965107/converting-between-strings-and-arraybuffers>
> >>> On Jun 11, 2018, at 12:02 PM, Yishay Weiss <yi...@hotmail.com>
> >> wrote:
> >>>
> >>> Carols,
> >>>
> >>>
> >>>
> >>> This breaks our app on IE and Edge, as they don’t support TextDecoder.
> >> Can you fix this?
> >>>
> >>>
> >>>
> >>> ________________________________
> >>> From: carlosrovira@apache.org <ca...@apache.org>
> >>> Sent: Sunday, May 27, 2018 11:29:14 PM
> >>> To: commits@royale.apache.org
> >>> Subject: [royale-asjs] branch develop updated: fix latest commit, since
> >> binary data to string method was not really working
> >>>
> >>> This is an automated email from the ASF dual-hosted git repository.
> >>>
> >>> carlosrovira pushed a commit to branch develop
> >>> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
> >>>
> >>>
> >>> The following commit(s) were added to refs/heads/develop by this push:
> >>>    new 028a26a  fix latest commit, since binary data to string method
> >> was not really working
> >>> 028a26a is described below
> >>>
> >>> commit 028a26ad29aac3740f150f9b971e310731a69db9
> >>> Author: Carlos Rovira <ca...@apache.org>
> >>> AuthorDate: Sun May 27 22:28:57 2018 +0200
> >>>
> >>>   fix latest commit, since binary data to string method was not really
> >> working
> >>> ---
> >>> .../Core/src/main/royale/org/apache/royale/utils/BinaryData.as
> |
> >> 4 ++--
> >>> 1 file changed, 2 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/frameworks/projects/Core/src/main/royale/org/apache/
> royale/utils/BinaryData.as
> >> b/frameworks/projects/Core/src/main/royale/org/apache/
> >> royale/utils/BinaryData.as
> >>> index 0aa3097..5500c8f 100644
> >>> --- a/frameworks/projects/Core/src/main/royale/org/apache/
> >> royale/utils/BinaryData.as
> >>> +++ b/frameworks/projects/Core/src/main/royale/org/apache/
> >> royale/utils/BinaryData.as
> >>> @@ -213,7 +213,7 @@ public class BinaryData implements
> IBinaryDataInput,
> >> IBinaryDataOutput
> >>>
> >>>        COMPILE::JS
> >>>        {
> >>> -            return String.fromCharCode.apply(null, new
> >> Uint16Array(ba));
> >>> +            return (new TextDecoder("utf-8")).decode(ba);
> >>>        }
> >>>        }
> >>>
> >>> @@ -804,7 +804,7 @@ public class BinaryData implements
> IBinaryDataInput,
> >> IBinaryDataOutput
> >>>        }
> >>>        COMPILE::JS
> >>>        {
> >>> -            return _len;;
> >>> +            return _len;
> >>>        }
> >>>    }
> >>>
> >>>
> >>> --
> >>> To stop receiving notification emails like this one, please contact
> >>> carlosrovira@apache.org.
> >>
> >>
> >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira <http://about.me/carlosrovira>
>



-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch develop updated: fix latest commit, since binary data to string method was not really working

Posted by Harbs <ha...@gmail.com>.
Why do you need toString rather than readUTFBytes()? FWIW, readUTFBytes() already falls back to TextDecoder when available.

> On Jun 11, 2018, at 2:07 PM, Carlos Rovira <ca...@apache.org> wrote:
> 
> Hi,
> 
> no problem, we can go back to how it was that line before. I changed it be
> have the same in all that class, but wasn't aware of that problem.
> So I'll change to what we had, and make to String do the same. I think it
> should work the same and as well work on IE/Edge
> 
> I'll take a look right now
> 
> 2018-06-11 11:13 GMT+02:00 Harbs <harbs.lists@gmail.com <ma...@gmail.com>>:
> 
>> FWIW, I always check web API support in MDN and caniuse.com before using
>> them in Royale.
>> 
>> Some more details win this specific issue:
>> 
>> It looks like you added toString() to BinaryData and changed UIDUtils to
>> use that.
>> 
>> I don’t think a toString method in BinaryData makes sense. Flash was very
>> smart about how it converted to a string. It was able to use the system
>> encoding if available. etc.
>> 
>> Trying to emulate that kind of behavior in BinaryData is not going to be
>> very PAYG. BinaryData already has UTF methods which cover the vast majority
>> of text needs with BinaryData. Other types of text conversions should be
>> handled using utility functions if needed.
>> 
>> There are ways to get cross-browser support similar to TextEncoder, but
>> it’s not very PAYG either.[1]
>> 
>> My $0.02,
>> Harbs
>> 
>> [1]https://stackoverflow.com/questions/6965107/converting-
>> between-strings-and-arraybuffers <https://stackoverflow.com/ <https://stackoverflow.com/>
>> questions/6965107/converting-between-strings-and-arraybuffers>
>>> On Jun 11, 2018, at 12:02 PM, Yishay Weiss <yi...@hotmail.com>
>> wrote:
>>> 
>>> Carols,
>>> 
>>> 
>>> 
>>> This breaks our app on IE and Edge, as they don’t support TextDecoder.
>> Can you fix this?
>>> 
>>> 
>>> 
>>> ________________________________
>>> From: carlosrovira@apache.org <ca...@apache.org>
>>> Sent: Sunday, May 27, 2018 11:29:14 PM
>>> To: commits@royale.apache.org
>>> Subject: [royale-asjs] branch develop updated: fix latest commit, since
>> binary data to string method was not really working
>>> 
>>> This is an automated email from the ASF dual-hosted git repository.
>>> 
>>> carlosrovira pushed a commit to branch develop
>>> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>>> 
>>> 
>>> The following commit(s) were added to refs/heads/develop by this push:
>>>    new 028a26a  fix latest commit, since binary data to string method
>> was not really working
>>> 028a26a is described below
>>> 
>>> commit 028a26ad29aac3740f150f9b971e310731a69db9
>>> Author: Carlos Rovira <ca...@apache.org>
>>> AuthorDate: Sun May 27 22:28:57 2018 +0200
>>> 
>>>   fix latest commit, since binary data to string method was not really
>> working
>>> ---
>>> .../Core/src/main/royale/org/apache/royale/utils/BinaryData.as        |
>> 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
>> b/frameworks/projects/Core/src/main/royale/org/apache/
>> royale/utils/BinaryData.as
>>> index 0aa3097..5500c8f 100644
>>> --- a/frameworks/projects/Core/src/main/royale/org/apache/
>> royale/utils/BinaryData.as
>>> +++ b/frameworks/projects/Core/src/main/royale/org/apache/
>> royale/utils/BinaryData.as
>>> @@ -213,7 +213,7 @@ public class BinaryData implements IBinaryDataInput,
>> IBinaryDataOutput
>>> 
>>>        COMPILE::JS
>>>        {
>>> -            return String.fromCharCode.apply(null, new
>> Uint16Array(ba));
>>> +            return (new TextDecoder("utf-8")).decode(ba);
>>>        }
>>>        }
>>> 
>>> @@ -804,7 +804,7 @@ public class BinaryData implements IBinaryDataInput,
>> IBinaryDataOutput
>>>        }
>>>        COMPILE::JS
>>>        {
>>> -            return _len;;
>>> +            return _len;
>>>        }
>>>    }
>>> 
>>> 
>>> --
>>> To stop receiving notification emails like this one, please contact
>>> carlosrovira@apache.org.
>> 
>> 
> 
> 
> -- 
> Carlos Rovira
> http://about.me/carlosrovira <http://about.me/carlosrovira>

Re: [royale-asjs] branch develop updated: fix latest commit, since binary data to string method was not really working

Posted by Carlos Rovira <ca...@apache.org>.
Hi, just committed a solution that does the same done in "readUTFBytes" on
line 985
Let me know if this solves the issue

2018-06-11 13:07 GMT+02:00 Carlos Rovira <ca...@apache.org>:

> Hi,
>
> no problem, we can go back to how it was that line before. I changed it be
> have the same in all that class, but wasn't aware of that problem.
> So I'll change to what we had, and make to String do the same. I think it
> should work the same and as well work on IE/Edge
>
> I'll take a look right now
>
> 2018-06-11 11:13 GMT+02:00 Harbs <ha...@gmail.com>:
>
>> FWIW, I always check web API support in MDN and caniuse.com before using
>> them in Royale.
>>
>> Some more details win this specific issue:
>>
>> It looks like you added toString() to BinaryData and changed UIDUtils to
>> use that.
>>
>> I don’t think a toString method in BinaryData makes sense. Flash was very
>> smart about how it converted to a string. It was able to use the system
>> encoding if available. etc.
>>
>> Trying to emulate that kind of behavior in BinaryData is not going to be
>> very PAYG. BinaryData already has UTF methods which cover the vast majority
>> of text needs with BinaryData. Other types of text conversions should be
>> handled using utility functions if needed.
>>
>> There are ways to get cross-browser support similar to TextEncoder, but
>> it’s not very PAYG either.[1]
>>
>> My $0.02,
>> Harbs
>>
>> [1]https://stackoverflow.com/questions/6965107/converting-be
>> tween-strings-and-arraybuffers <https://stackoverflow.com/que
>> stions/6965107/converting-between-strings-and-arraybuffers>
>> > On Jun 11, 2018, at 12:02 PM, Yishay Weiss <yi...@hotmail.com>
>> wrote:
>> >
>> > Carols,
>> >
>> >
>> >
>> > This breaks our app on IE and Edge, as they don’t support TextDecoder.
>> Can you fix this?
>> >
>> >
>> >
>> > ________________________________
>> > From: carlosrovira@apache.org <ca...@apache.org>
>> > Sent: Sunday, May 27, 2018 11:29:14 PM
>> > To: commits@royale.apache.org
>> > Subject: [royale-asjs] branch develop updated: fix latest commit, since
>> binary data to string method was not really working
>> >
>> > This is an automated email from the ASF dual-hosted git repository.
>> >
>> > carlosrovira pushed a commit to branch develop
>> > in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>> >
>> >
>> > The following commit(s) were added to refs/heads/develop by this push:
>> >     new 028a26a  fix latest commit, since binary data to string method
>> was not really working
>> > 028a26a is described below
>> >
>> > commit 028a26ad29aac3740f150f9b971e310731a69db9
>> > Author: Carlos Rovira <ca...@apache.org>
>> > AuthorDate: Sun May 27 22:28:57 2018 +0200
>> >
>> >    fix latest commit, since binary data to string method was not really
>> working
>> > ---
>> > .../Core/src/main/royale/org/apache/royale/utils/BinaryData.as
>> | 4 ++--
>> > 1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
>> b/frameworks/projects/Core/src/main/royale/org/apache/royale
>> /utils/BinaryData.as
>> > index 0aa3097..5500c8f 100644
>> > --- a/frameworks/projects/Core/src/main/royale/org/apache/royale
>> /utils/BinaryData.as
>> > +++ b/frameworks/projects/Core/src/main/royale/org/apache/royale
>> /utils/BinaryData.as
>> > @@ -213,7 +213,7 @@ public class BinaryData implements
>> IBinaryDataInput, IBinaryDataOutput
>> >
>> >         COMPILE::JS
>> >         {
>> > -            return String.fromCharCode.apply(null, new
>> Uint16Array(ba));
>> > +            return (new TextDecoder("utf-8")).decode(ba);
>> >         }
>> >         }
>> >
>> > @@ -804,7 +804,7 @@ public class BinaryData implements
>> IBinaryDataInput, IBinaryDataOutput
>> >         }
>> >         COMPILE::JS
>> >         {
>> > -            return _len;;
>> > +            return _len;
>> >         }
>> >     }
>> >
>> >
>> > --
>> > To stop receiving notification emails like this one, please contact
>> > carlosrovira@apache.org.
>>
>>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch develop updated: fix latest commit, since binary data to string method was not really working

Posted by Carlos Rovira <ca...@apache.org>.
Hi,

no problem, we can go back to how it was that line before. I changed it be
have the same in all that class, but wasn't aware of that problem.
So I'll change to what we had, and make to String do the same. I think it
should work the same and as well work on IE/Edge

I'll take a look right now

2018-06-11 11:13 GMT+02:00 Harbs <ha...@gmail.com>:

> FWIW, I always check web API support in MDN and caniuse.com before using
> them in Royale.
>
> Some more details win this specific issue:
>
> It looks like you added toString() to BinaryData and changed UIDUtils to
> use that.
>
> I don’t think a toString method in BinaryData makes sense. Flash was very
> smart about how it converted to a string. It was able to use the system
> encoding if available. etc.
>
> Trying to emulate that kind of behavior in BinaryData is not going to be
> very PAYG. BinaryData already has UTF methods which cover the vast majority
> of text needs with BinaryData. Other types of text conversions should be
> handled using utility functions if needed.
>
> There are ways to get cross-browser support similar to TextEncoder, but
> it’s not very PAYG either.[1]
>
> My $0.02,
> Harbs
>
> [1]https://stackoverflow.com/questions/6965107/converting-
> between-strings-and-arraybuffers <https://stackoverflow.com/
> questions/6965107/converting-between-strings-and-arraybuffers>
> > On Jun 11, 2018, at 12:02 PM, Yishay Weiss <yi...@hotmail.com>
> wrote:
> >
> > Carols,
> >
> >
> >
> > This breaks our app on IE and Edge, as they don’t support TextDecoder.
> Can you fix this?
> >
> >
> >
> > ________________________________
> > From: carlosrovira@apache.org <ca...@apache.org>
> > Sent: Sunday, May 27, 2018 11:29:14 PM
> > To: commits@royale.apache.org
> > Subject: [royale-asjs] branch develop updated: fix latest commit, since
> binary data to string method was not really working
> >
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > carlosrovira pushed a commit to branch develop
> > in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
> >
> >
> > The following commit(s) were added to refs/heads/develop by this push:
> >     new 028a26a  fix latest commit, since binary data to string method
> was not really working
> > 028a26a is described below
> >
> > commit 028a26ad29aac3740f150f9b971e310731a69db9
> > Author: Carlos Rovira <ca...@apache.org>
> > AuthorDate: Sun May 27 22:28:57 2018 +0200
> >
> >    fix latest commit, since binary data to string method was not really
> working
> > ---
> > .../Core/src/main/royale/org/apache/royale/utils/BinaryData.as        |
> 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
> b/frameworks/projects/Core/src/main/royale/org/apache/
> royale/utils/BinaryData.as
> > index 0aa3097..5500c8f 100644
> > --- a/frameworks/projects/Core/src/main/royale/org/apache/
> royale/utils/BinaryData.as
> > +++ b/frameworks/projects/Core/src/main/royale/org/apache/
> royale/utils/BinaryData.as
> > @@ -213,7 +213,7 @@ public class BinaryData implements IBinaryDataInput,
> IBinaryDataOutput
> >
> >         COMPILE::JS
> >         {
> > -            return String.fromCharCode.apply(null, new
> Uint16Array(ba));
> > +            return (new TextDecoder("utf-8")).decode(ba);
> >         }
> >         }
> >
> > @@ -804,7 +804,7 @@ public class BinaryData implements IBinaryDataInput,
> IBinaryDataOutput
> >         }
> >         COMPILE::JS
> >         {
> > -            return _len;;
> > +            return _len;
> >         }
> >     }
> >
> >
> > --
> > To stop receiving notification emails like this one, please contact
> > carlosrovira@apache.org.
>
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch develop updated: fix latest commit, since binary data to string method was not really working

Posted by Harbs <ha...@gmail.com>.
FWIW, I always check web API support in MDN and caniuse.com before using them in Royale.

Some more details win this specific issue:

It looks like you added toString() to BinaryData and changed UIDUtils to use that.

I don’t think a toString method in BinaryData makes sense. Flash was very smart about how it converted to a string. It was able to use the system encoding if available. etc.

Trying to emulate that kind of behavior in BinaryData is not going to be very PAYG. BinaryData already has UTF methods which cover the vast majority of text needs with BinaryData. Other types of text conversions should be handled using utility functions if needed.

There are ways to get cross-browser support similar to TextEncoder, but it’s not very PAYG either.[1]

My $0.02,
Harbs

[1]https://stackoverflow.com/questions/6965107/converting-between-strings-and-arraybuffers <https://stackoverflow.com/questions/6965107/converting-between-strings-and-arraybuffers>
> On Jun 11, 2018, at 12:02 PM, Yishay Weiss <yi...@hotmail.com> wrote:
> 
> Carols,
> 
> 
> 
> This breaks our app on IE and Edge, as they don’t support TextDecoder. Can you fix this?
> 
> 
> 
> ________________________________
> From: carlosrovira@apache.org <ca...@apache.org>
> Sent: Sunday, May 27, 2018 11:29:14 PM
> To: commits@royale.apache.org
> Subject: [royale-asjs] branch develop updated: fix latest commit, since binary data to string method was not really working
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> carlosrovira pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
> 
> 
> The following commit(s) were added to refs/heads/develop by this push:
>     new 028a26a  fix latest commit, since binary data to string method was not really working
> 028a26a is described below
> 
> commit 028a26ad29aac3740f150f9b971e310731a69db9
> Author: Carlos Rovira <ca...@apache.org>
> AuthorDate: Sun May 27 22:28:57 2018 +0200
> 
>    fix latest commit, since binary data to string method was not really working
> ---
> .../Core/src/main/royale/org/apache/royale/utils/BinaryData.as        | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
> index 0aa3097..5500c8f 100644
> --- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
> +++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
> @@ -213,7 +213,7 @@ public class BinaryData implements IBinaryDataInput, IBinaryDataOutput
> 
>         COMPILE::JS
>         {
> -            return String.fromCharCode.apply(null, new Uint16Array(ba));
> +            return (new TextDecoder("utf-8")).decode(ba);
>         }
>         }
> 
> @@ -804,7 +804,7 @@ public class BinaryData implements IBinaryDataInput, IBinaryDataOutput
>         }
>         COMPILE::JS
>         {
> -            return _len;;
> +            return _len;
>         }
>     }
> 
> 
> --
> To stop receiving notification emails like this one, please contact
> carlosrovira@apache.org.


RE: [royale-asjs] branch develop updated: fix latest commit, since binary data to string method was not really working

Posted by Yishay Weiss <yi...@hotmail.com>.
Carols,



This breaks our app on IE and Edge, as they don’t support TextDecoder. Can you fix this?



________________________________
From: carlosrovira@apache.org <ca...@apache.org>
Sent: Sunday, May 27, 2018 11:29:14 PM
To: commits@royale.apache.org
Subject: [royale-asjs] branch develop updated: fix latest commit, since binary data to string method was not really working

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 028a26a  fix latest commit, since binary data to string method was not really working
028a26a is described below

commit 028a26ad29aac3740f150f9b971e310731a69db9
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun May 27 22:28:57 2018 +0200

    fix latest commit, since binary data to string method was not really working
---
 .../Core/src/main/royale/org/apache/royale/utils/BinaryData.as        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
index 0aa3097..5500c8f 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/BinaryData.as
@@ -213,7 +213,7 @@ public class BinaryData implements IBinaryDataInput, IBinaryDataOutput

         COMPILE::JS
         {
-            return String.fromCharCode.apply(null, new Uint16Array(ba));
+            return (new TextDecoder("utf-8")).decode(ba);
         }
         }

@@ -804,7 +804,7 @@ public class BinaryData implements IBinaryDataInput, IBinaryDataOutput
         }
         COMPILE::JS
         {
-            return _len;;
+            return _len;
         }
     }


--
To stop receiving notification emails like this one, please contact
carlosrovira@apache.org.