2012-08-17 59 views
3

我已經創建了網絡服務來獲取從數據庫這是在古吉拉特(其他語言)的數據。問題,而使用Web服務從數據庫中獲取數據

雖然我訪問網絡服務的瀏覽器中我得到這個URL「????????????」而不是真實的數據。

請幫我把它弄出來。

感謝

+0

要看做什麼編碼的網站使用,而你在瀏覽器 – Gntem 2012-08-17 12:14:32

+0

bdia問題的Rahul使用何種編碼,我upvoted – GLES 2012-08-17 12:31:07

回答

1

拉胡爾BHAI,儘量先運行此腳本:

<?php 
$mysqli = new mysqli("localhost", "my_user", "my_password", "test"); 

/* check connection */ 
if (mysqli_connect_errno()) { 
    printf("Connect failed: %s\n", mysqli_connect_error()); 
    exit(); 
} 

/* change character set to utf8 */ 
if (!$mysqli->set_charset("utf8")) { 
    printf("Error loading character set utf8: %s\n", $mysqli->error); 
} else { 
    printf("Current character set: %s\n", $mysqli->character_set_name()); 
} 

$mysqli->close(); 
? 

如果你可以修改網站服務,盡力字符集設置爲utf-8如上圖所示,或瀏覽StackOverflow的類似問題,即用戶要求設置的字符集等

+0

拉胡爾BHAI PLZ「給予好評」 /「標記爲答案」是否能解決你的問題 – GLES 2012-08-17 12:33:12

+0

嘿老兄!做了這項工作? – GLES 2012-08-17 12:45:13

+1

不完全,但我從這 – 2012-08-21 11:25:09

2

你必須設置編碼

ini_set('default_charset', 'utf-8'); 

在您的web服務php文件。

+0

標題('Content-Type:text/html; charset = UTF-8')得到了一些解決方案;設置這個已經http://stackoverflow.com/questions/8229696/do-i-need-to-set-ini-set-default-charset-utf-8 – GLES 2012-08-17 12:30:26

+1

一些次組頭不匹配您定義的一個http://stackoverflow.com/questions/4279282/set-http-header-to-utf-8-php – 2012-08-17 12:40:39

+0

感謝Harshal姬的信息:d – GLES 2012-08-17 12:46:24

相關問題