Decodes a string b to UTF-8

Property definitions

core $ Codec :: decode_string
	# Decodes a string `b` to UTF-8
	fun decode_string(b: CString, len: Int): String is abstract
lib/core/codecs/codec_base.nit:65,2--66,60

core $ UTF8Codec :: decode_string
	redef fun decode_string(ns, len) do
		assert len >= 0
		var ret = ns.to_s_unsafe(len, copy=false)
		var rit = ret.as(FlatString).items
		if rit == ns then
			var nns = new CString(len)
			rit.copy_to(nns, len, 0, 0)
			return nns.to_s_unsafe(ret.byte_length, ret.length, copy=false)
		end
		return ret
	end
lib/core/codecs/utf8.nit:70,2--80,4

core $ ISO88591Codec :: decode_string
	redef fun decode_string(b, len) do
		var buf = new Bytes.with_capacity(len)
		for i in [0 .. len[ do buf.add_char(b[i].to_i.code_point)
		return buf.to_s
	end
lib/core/codecs/iso8859_1.nit:70,2--74,4