[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[jx8-android] 013 - Strings

"returning a string (Unicode BMP)"
| string c |
c := String fromCharCode: 16r2605.
string := Java current
	callStaticMethodSync: #Test
	method: #getUnicodeBMP.
c = string ifFalse: [
	self error: 'Wrong result string=',string ,' ascii=',string asciiValue
].


"returning a string (Unicode SMP)"
| string c |
"The below string is U+1F596, represented as surrogate pairs"
c := String fromCharCode: #(16rD83D 16rDD96).
string := Java current
	callStaticMethodSync: #Test
	method: #getUnicodeSMP.
c = string ifFalse: [
	self error: 'Wrong result string=',string ,' ascii=',string asciiValue
].


"returning a string (NULL char)"
| string c |
c := String fromCharCode: 0.
string := Java current
	callStaticMethodSync: #Test
	method: #getUnicodeNull.
c = string ifFalse: [
	self error: 'Wrong result string=',string ,' ascii=',string asciiValue
].