Data from oracle in utf-8 with php

前端 未结 3 1520
-上瘾入骨i
-上瘾入骨i 2020-12-18 01:16

i have a problem about getting data from oracle database. How to get data in utf-8? browser shows symbols with echo, but data from oracle has ? marks instead of letters

相关标签:
3条回答
  • 2020-12-18 01:41

    Use this to make database connection:

    $conn = oci_connect(username,pass, $tns2 , 'AL32UTF8')
    
    0 讨论(0)
  • 2020-12-18 01:46

    set php encoding to utf 8

    mb_internal_encoding("UTF-8");
    

    link for more http://php.net/manual/en/function.mb-internal-encoding.php

    0 讨论(0)
  • 2020-12-18 01:47

    Simple solution. Only add 'AL32UTF8' to line if ($conn = oci_connect(username,pass, $tns2 , 'AL32UTF8')) Everything works now. Thank you for help

    0 讨论(0)
提交回复
热议问题