Unicode(Cyrillic) in URL Java, Android

0 like 0 dislike
3 views
Tell me how in Java when developing for Android to convert a string with Cyrillic something like: "%D0%B3%D1%80%D1%83%D0%BF%D0%BF%D0%B0".
In the above example, the encrypted word is "group".
All this is necessary for use in the URL to request the html page.

Thank you!
by | 3 views

4 Answers

0 like 0 dislike
URLEncoder.encode("group", "UTF-8")
by
0 like 0 dislike
I don't know about Java specifically, but in any case, you can try to convert yourself, in Unicode, not encode
for example: if hexoban editor to choose D0BAD180D0BED0B2D0B8 and view the resulting file in unicodemap editor, we get the word "blood"
when recoding the url is in fact %D0%BA%D1%80%D0%BE%D0%B2%D0%B8, the reverse operation is not prohibited.
In a pinch you can make a hash of the alphabet(don't really know how is it with the hashes in Java) and frame.
The truth here is of course nyuansik there, not all symbols are encoded, for example, but the Russian alphabet is quite.
May guru Java that prompt.
by
0 like 0 dislike
To parse a UTF-8 string into bytes, each byte to represent a hexadecimal number, in front of which to put the symbol %.
by
0 like 0 dislike
Thank you all for the answers! apangin — especially! What I was looking for. Don't understand how I got it sinaguglia...
All on the plus and the karma :)
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
4 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
28,780 users