Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

udpate for gnu smalltalk compat

  • Loading branch information...
commit cec91919d5766fc6c1adb5546bb14989abfda7bd 1 parent 49edb9b
@timfel timfel authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 JSON/Json.st
View
7 JSON/Json.st
@@ -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].
{$" -> '\"'.
$\ -> '\\'.
Please sign in to comment.
Something went wrong with that request. Please try again.