How to tanslate Korean to English through PL/SQL
73661Aug 4 2011 — edited Aug 5 2011The following blocks can translate English to Korean. But how can I translate Korean into English? utl_url.ESCAPE does not work when Korean or other double byte characters passed in.
SET define OFF
SET serveroutput ON
BEGIN
DECLARE
txt VARCHAR2(100);
tlum VARCHAR2(200);
tlum_out VARCHAR2(200);
BEGIN
txt:=utl_url.ESCAPE('This is a new world');
tlum := REGEXP_SUBSTR(httpuritype ('http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q='||txt||'&langpair=en|ko').getclob (),'".*?"' ,1,3);
DBMS_OUTPUT.PUT_LINE(tlum);
COMMIT;
END;
END;