2013년 1월 27일 일요일

DataSnap REST 에서 한글(utf8) 사용

DataSnap REST 에서 한글(utf8)을 사용하려고 Template의 html의 헤더에
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
을 포함하여도 한글이 제대로 표현되지 않습니다.

예전에 WebBroker 에서 한글처리하기 위하여서는
해당 엑션에서
Response.ContentType := 'text/html; charset=utf-8';
Response.ContentEncoding := 'utf-8';
지정하여 하였었습니다.

DataSnap Rest 에서는
WebModuleUnit1.pas 에서


procedure TWebModule1.WebModuleBeforeDispatch(Sender: TObject;
  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
  Response.ContentType := 'text/html; charset=utf-8'; // 추가
  Response.ContentEncoding := 'utf-8'; //추가
  if FServerFunctionInvokerAction <> nil then
    FServerFunctionInvokerAction.Enabled := AllowServerFunctionInvoker;
end;


하여서 해결하였습니다.


댓글 없음:

tensorflow gpu 사용하기에서

 tensorflow 설치시 주의해야 한다. # Anything above 2.10 is not supported on the GPU on Windows Native python - m pip install "tensorflow<2.11...