<%@ page contentType="text/html;charset=utf-8"%> <%@ page import="java.io.*" %> 顏氏美語 俗語俚語選集 <%! static int CN = 86; static int TW = 886; int enc = TW; %> <% Cookie[] cookies = request.getCookies(); if (cookies!= null) { for (int i=0; i
<%= enc%>

<% if (enc==TW) {%> <% StringBuffer ostr = new StringBuffer(); try { BufferedReader inFile = new BufferedReader(new InputStreamReader(new FileInputStream("/home/hyen/OnlineDict/Slang/traditional/slang1.html"), "UTF8")); String str=null; while ((str=inFile.readLine()) != null) { ostr.append(str); } } catch(IOException e) { out.println(e); } out.print(ostr.toString()); %> <%} else {%> <% StringBuffer ostr = new StringBuffer(); try { BufferedReader inFile = new BufferedReader(new InputStreamReader(new FileInputStream("/home/hyen/OnlineDict/Slang/simplified/slang1.html"), "UTF8")); String str=null; while ((str=inFile.readLine()) != null) { ostr.append(str); } } catch(IOException e) { out.println(e); } out.print(ostr.toString()); %> <%}%>