{"json_modified": "2016-03-28T08:40:51.360121", "uuid": "23f0ddf5-2cdd-4c1e-9e1e-092b728808b4", "title": "JS_EncodeStringToBuffer", "url": "/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_EncodeStringToBuffer", "tags": ["R\u00e9f\u00e9rence", "Reference", "SpiderMonkey", "JSAPI Reference"], "translations": [], "modified": "2015-01-18T13:14:06", "label": "JS_EncodeStringToBuffer", "localization_tags": [], "locale": "en-US", "id": 132827, "last_edit": "2015-01-18T13:13:57", "summary": "JS_EncodeStringToBuffer converts the specified JavaScript str to a C string (an array of 8-bit chars) and fills the specified buffer with up to length bytes of the string in UTF-8 format. It returns the length of the whole string encoding or (size_t)-1 if the string can't be encoded as bytes. If the returned value is greater than the length you specified, the string was truncated.", "sections": [{"id": "Quick_Links", "title": null}, {"id": "Syntax", "title": "Syntax"}, {"id": "Description", "title": "Description"}, {"id": "See_Also", "title": "See Also"}], "slug": "Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_EncodeStringToBuffer", "review_tags": ["technical"]}