How to fetch hindi string from php file and set into android textview properly -


i have php file contains hindi string want fetch exact string in android, send encoded value

abc.php:

<?php     echo "शुभ प्रभात"; ?> 

in android:

@override         protected void onpostexecute(string s) {          toast.maketext(getactivity(), "message :+s, toast.length_long).show(); } 

output got: enter image description here

i tried

 urldecoder.decode 

and try

typeface typeface = typeface.createfromasset(context.getassets(), "hindi.ttf"); hometitle.settypeface(typeface); 

for set textview nothing works me.

assets: enter image description here

you need declare character set php file like

header('content-type: text/plain; charset=utf-8'); 

then after can try fetch json service give proper data. in case example

<?php     header('content-type: text/plain; charset=utf-8');     echo "शुभ प्रभात"; ?> 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -