数据库版本 9i程序显示从数据库中读取的英文 数字瞪内容显示正确,但是对读取的中文内容无法显示是何缘故应该如何设置呢

解决方案 »

  1.   

    以下是我的代码#include <iostream>
    #include <string.h>
    using namespace std;
    #include <stdio.h>//#define OTL_UNICODE
    #define OTL_ORA9I // Compile OTL 4.0/OCI9i
    #define OTL_ORA_TIMESTAMP // enable Oracle 9i TIMESTAMPs [with [local] time zone]
    #include "otlv4.h" // include the OTL 4.0 header fileotl_connect db; // connect object
    void select(int myindex)
    {
     int fee;
     char service[20],content[20];
     otl_stream i(1,"select service_id,fee,msg_content  from tb_sm_content where msg_index=:f<int>",db); 
     i<<myindex; while(!i.eof())
     {  
    i>>service>>fee>>content;
    cout<<service<<"\n"<<fee<<"\n"<<content<<"\n";
     }
     
    }int main()
    {
      otl_connect::otl_initialize();  try{  db.rlogon("wap/ptaxwap18@xb18");
      select(1); } catch(otl_exception& p){ 
      cerr<<p.msg<<endl; 
      cerr<<p.stm_text<<endl; 
      cerr<<p.sqlstate<<endl; 
      cerr<<p.var_info<<endl; 
     } db.logoff(); // disconnect from Oracle return 0;}