Is UTF-16 a problem?

185 views
Skip to first unread message

Martin

unread,
Dec 9, 2014, 1:02:56 PM12/9/14
to mi...@dartlang.org
Hi,

in Dart strings are UTF-16 because of Webkit. While on the client side (browser) this might be beneficial, on the server side this introduces unnecessary overhead. HTTP requests, database strings, ... are converted to UTF-16 and need to be converted back to UTF-8 for output.

Does that degrade performance noticeably? Does the Dart VM do anything to avoid converting to UTF-16 and back?

Martin

Austin Cummings

unread,
Dec 14, 2014, 4:33:20 PM12/14/14
to mi...@dartlang.org
I believe in the Dart VM they do optimizations for one byte strings (UTF-8). I am not sure though.

--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.

Lasse R.H. Nielsen

unread,
Dec 15, 2014, 7:52:02 AM12/15/14
to mi...@dartlang.org

Dart's one-byte strings are Latin-1 strings, not UTF-8. Is just said space internally when all the code units of a string are <256.

/L

Randal L. Schwartz

unread,
Dec 15, 2014, 4:16:31 PM12/15/14
to mi...@dartlang.org
>>>>> "Nielsen" == 'Lasse R H Nielsen' via Dart Misc <mi...@dartlang.org> writes:

Nielsen> Dart's one-byte strings are Latin-1 strings, not UTF-8. Is just
Nielsen> said space internally when all the code units of a string are
Nielsen> <256.

Latin-1? Why not ASCII, which has the advantage that it can't be
confused with an improperly marked UTF-8 string, since every ASCII
string is automatically a UTF-8 string.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<mer...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix consulting, Technical writing, Comedy, etc. etc.
Still trying to think of something clever for the fourth line of this .sig

Alan Knight

unread,
Dec 15, 2014, 5:15:21 PM12/15/14
to mi...@dartlang.org
These are internal VM data structures. I don't think "improperly marked" is something that can happen.


Reply all
Reply to author
Forward
0 new messages