Changeset fbb4dbaf45035fe41320c44d9a5950eefeb1e34b
- Timestamp:
- 05/01/07 11:29:33
(2 years ago)
- Author:
- Christopher Jung <bktheg@web.de>
- git-committer:
- Christopher Jung <bktheg@web.de> 1178011773 +0200
- git-parent:
[6af2de02a48bb6019f3271f65ae9d3016bb64456]
- git-author:
- Christopher Jung <bktheg@web.de> 1178011773 +0200
- Message:
Ausgabe ist in einigen Faellen XML mit UTF-16
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r34c2c2b |
rfbb4dba |
|
| 134 | 134 | @Override |
|---|
| 135 | 135 | protected void printHeader( String action ) { |
|---|
| 136 | | getContext().getResponse().setContentType("text/plain"); |
|---|
| 137 | | getContext().getResponse().setCharSet("ISO-8859-1"); |
|---|
| | 136 | if( action.equals("showSector") || action.equals("getSystems") ) { |
|---|
| | 137 | getContext().getResponse().setContentType("text/xml"); |
|---|
| | 138 | getContext().getResponse().setCharSet("UTF-16"); |
|---|
| | 139 | } |
|---|
| | 140 | else { |
|---|
| | 141 | getContext().getResponse().setContentType("text/plain"); |
|---|
| | 142 | getContext().getResponse().setCharSet("ISO-8859-1"); |
|---|
| | 143 | } |
|---|
| 138 | 144 | } |
|---|
| 139 | 145 | |
|---|
| … | … | |
| 180 | 186 | |
|---|
| 181 | 187 | User auser = getContext().createUserObject(aship.getInt("owner")); |
|---|
| 182 | | echo.append("<ownername><![CDATA["+new String(auser.getName().getBytes("UTF-8"), "UTF-8")+"]]></ownername>\n"); |
|---|
| 183 | | echo.append("<picture><![CDATA["+new String(stype.getString("picture").getBytes("UTF-8"),"UTF-8")+"]]></picture>\n"); |
|---|
| | 188 | echo.append("<ownername><![CDATA["+auser.getName()+"]]></ownername>\n"); |
|---|
| | 189 | echo.append("<picture><![CDATA["+stype.getString("picture")+"]]></picture>\n"); |
|---|
| 184 | 190 | |
|---|
| 185 | 191 | echo.append("<type id=\""+stype.getInt("id")+"\">\n"); |
|---|
| 186 | | echo.append("<name><![CDATA["+new String(stype.getString("nickname").getBytes("UTF-8"),"UTF-8")+"]]></name>\n"); |
|---|
| | 192 | echo.append("<name><![CDATA["+stype.getString("nickname")+"]]></name>\n"); |
|---|
| 187 | 193 | echo.append("<hull>"+stype.getInt("hull")+"</hull>\n"); |
|---|
| 188 | 194 | echo.append("<shields>"+stype.getInt("shields")+"</shields>\n"); |
|---|
| … | … | |
| 192 | 198 | echo.append("</type>\n"); |
|---|
| 193 | 199 | |
|---|
| 194 | | echo.append("<name><![CDATA["+new String(aship.getString("name").getBytes("UTF-8"),"UTF-8")+"]]></name>\n"); |
|---|
| | 200 | echo.append("<name><![CDATA["+aship.getString("name")+"]]></name>\n"); |
|---|
| 195 | 201 | echo.append("<hull>"+aship.getInt("hull")+"</hull>\n"); |
|---|
| 196 | 202 | echo.append("<shields>"+aship.getInt("shields")+"</shields>\n"); |
|---|
| … | … | |
| 224 | 230 | |
|---|
| 225 | 231 | StringBuffer echo = getContext().getResponse().getContent(); |
|---|
| 226 | | echo.append("<?xml version='1.0' encoding='UTF-8'?>\n"); |
|---|
| | 232 | echo.append("<?xml version='1.0' encoding='UTF-16'?>\n"); |
|---|
| 227 | 233 | echo.append("<sector x=\""+x+"\" y=\""+y+"\" system=\""+this.system+"\">\n"); |
|---|
| 228 | 234 | |
|---|
| … | … | |
| 345 | 351 | StringBuffer echo = getContext().getResponse().getContent(); |
|---|
| 346 | 352 | |
|---|
| 347 | | echo.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); |
|---|
| | 353 | echo.append("<?xml version=\"1.0\" encoding=\"UTF-16\"?>\n"); |
|---|
| 348 | 354 | echo.append("<systems>\n"); |
|---|
| 349 | 355 | for( StarSystem asystem : Systems.get() ) { |
|---|