Talk:Binary strings: Difference between revisions

m
added/forced a TOC (for now).
m (added/forced a TOC (for now).)
 
(3 intermediate revisions by 2 users not shown)
Line 1:
__TOC__
 
== Break out? ==
 
Line 29 ⟶ 31:
::: Maybe there's a method in the String class that says Java not to "interpret" the string, or maybe such a task in Java should be accomplished using a custom class innerly using byte[]. --[[User:ShinTakezou|ShinTakezou]] 21:53, 15 April 2009 (UTC)
::::Java has a String method <tt>toByteArray()</tt>, but I think the actual tasks need to be customized. --[[User:Mwn3d|Mwn3d]] 22:14, 15 April 2009 (UTC)
 
== Comment: PureBasic does not have real binary strings ==
 
I would like to comment on the given PureBasic code for binary strings.
 
The example code using variables with a $ postfix and string literals
enclosed in double quotes (") does use normal PureBasic strings.
 
Those PureBasic strings are 0 terminated.
They may not contain Chr(0)
and therefore are not binary safe.
 
If you want to handle "strings made of arbitrary bytes" in PureBasic,
you could use memory buffers or byte arrays,
but the code required for handling such,
is more evolved, than I am prepared to produce at this moment.
 
== Alternative implementation ==
 
"If your language of choice does have this built-in support, show a possible alternative implementation for the functions or abilities already provided by the language."
 
For a language that has no limitations on byte values within a byte string, reimplementing something so primitive would be madness, and thankfully, no one yet has taken it seriously. Reimplement without using bytes? without using arrays? Or, use existing language features, but pointlessly wrap them in functions with more cumbersome syntax? As worded, I can't imagine the task as anything but an exercise in obfuscation. &mdash;[[User:Sonia|Sonia]] 00:29, 14 February 2011 (UTC)
 
:Different mood today. I posted a solution. &mdash;[[User:Sonia|Sonia]] 21:30, 18 September 2012 (UTC)