Permalink
Browse files

udpate for gnu smalltalk compat

  • Loading branch information...
timfel committed Jun 15, 2010
1 parent 49edb9b commit cec91919d5766fc6c1adb5546bb14989abfda7bd
Showing with 3 additions and 4 deletions.
  1. +3 −4 JSON/Json.st
View
@@ -19,14 +19,13 @@ Object subclass: Json [
Json class >> initialize [
"Json initialize."
+ | tmpStr |
escapeArray := (1 to: 128) collect: [:i | Character value: i - 1].
(0 to: 31) , #(127) do:
[:each |
+ tmpStr := String streamContents: [:str | each printOn: str base: 16].
escapeArray at: each + 1
- put: '\u' , (each printStringHex
- padded: #left
- to: 4
- with: $0)].
+ put: '\u' , (String new: (4 - tmpStr size max: 0) withAll: $0) , tmpStr].
{$" -> '\"'.
$\ -> '\\'.

0 comments on commit cec9191

Please sign in to comment.