Hello,
the following code works with Squeak, but not with VisualWorks:
codec := GRCodec forEncoding: 'UTF-8'.
stream := codec encoderFor: (WriteStream on: (String new)).
stream nextPutAll: '<?xml version="1.0" encoding="utf-8"?>'.
-->
Unhandled exception: Strings only store Characters
ByteString(Object)>>error:
ByteString>>at:put:
WriteStream(InternalStream)>>pastEndPut:
WriteStream>>nextPut:
UTF8StreamEncoder>>write:on:
EncodedStream>>nextPut:
EncodedStream(Stream)>>next:putAll:startingAt:
EncodedStream(Stream)>>nextPutAll:
Grease.GRGenericCodecStream>>nextPutAll:
<--
Looks like VW expects a binary stream. But Squeak expects a character
stream and fails when a binary stream is used.
The following code works and returns a String:
(GRCodec forEncoding: 'UTF-8') encode: 'Hello'
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc