Changeset 133:8628ef19f353
- Timestamp:
- 10/20/13 22:22:55 (11 years ago)
- Author:
- František Kučera <franta-hg@…>
- Branch:
- default
- Message:
-
wiki: konstanta utf-8
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
r92
|
r133
|
|
27 | 27 | import java.net.URLConnection; |
28 | 28 | import java.net.URLEncoder; |
| 29 | import java.nio.charset.StandardCharsets; |
29 | 30 | |
30 | 31 | /** |
… |
… |
|
117 | 118 | if (pokračovat == 'a') { |
118 | 119 | OutputStreamWriter požadavek = null; |
119 | | BufferedReader odpověď = null; |
120 | | final String kódování = "UTF-8"; |
| 120 | BufferedReader odpověď = null; |
121 | 121 | try { |
122 | 122 | URL url = new URL(URL_TEXY); |
… |
… |
|
126 | 126 | /** Odešleme data */ |
127 | 127 | požadavek = new OutputStreamWriter(spojeni.getOutputStream()); |
128 | | požadavek.write(URLEncoder.encode(wiki, kódování)); |
| 128 | požadavek.write(URLEncoder.encode(wiki, StandardCharsets.UTF_8.name())); |
129 | 129 | požadavek.flush(); |
130 | 130 | |
131 | 131 | /** Přijmeme odpověď */ |
132 | | odpověď = new BufferedReader(new InputStreamReader(spojeni.getInputStream(), kódování)); |
| 132 | odpověď = new BufferedReader(new InputStreamReader(spojeni.getInputStream(), StandardCharsets.UTF_8.name())); |
133 | 133 | StringBuilder vysledek = new StringBuilder(); |
134 | 134 | String radka; |