]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Adding getBytes for String in SCL 06/1406/2
authorjsimomaa <jani.simomaa@gmail.com>
Tue, 30 Jan 2018 09:13:05 +0000 (11:13 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 30 Jan 2018 14:18:40 +0000 (16:18 +0200)
refs #7732

Change-Id: Ic340712ffbbc6944c0b31e2420f6adfacce29eaf

bundles/org.simantics.scl.runtime/scl/Prelude.scl

index eb8026de910e15f2b8900c2e0fce6a6d6a0d0d6e..bb6452429b39141a10a45ae19dbf4ad0736d0745 100644 (file)
@@ -1421,6 +1421,11 @@ importJava "java.lang.String" where
     "Creates a string from a vector of characters."
     @JavaName "<init>"
     string :: Vector Character -> String
+    
+    getBytes :: String -> String -> ByteArray
+
+getBytesUTF8 :: String -> ByteArray
+getBytesUTF8 str = getBytes str "UTF-8"
 
 instance Ord String where
     compare = compareString