Chinese Lunar Calendar

부분 유료
분류별 copy2sim | 업데이트됨 2 mesi fa | Data
인기

8.4 / 10

지연 시간

450ms

서비스 수준

100%

Health Check

N/A

모든 토론으로 돌아가기

lunarDateinChinese - Chinese Characters are not displayed in the Response

Rapid account: BTRTSIT
BTRTSIT
10 mesi fa

{“solarDate”: {“solarDay”: 2, “solarMonth”: 7, “solarYear”: 2020}, “lunarDate”: {“isleap”: 0, “lunarDay”: 12, “lunarMonth”: 5, “lunarYear”: 2020}, “lunarDateinChinese”: “\u4e94\u6708\u5341\u4e8c”, “sexagenaryCycle”: “\u5e9a\u5b50”, “solarTerm”: “”, “solarTerminEnglish”: “”, “festival”: “”, “chineseZodiacSign”: “\u9f20”, “chineseZodiacSigninEnglish”: “Rat”, “westernZodiacSign”: “\u5de8\u87f9\u5ea7”, “westernZodiacSigninEnglish”: “Cancer”}

lunarDateinChinese

Rapid account: Copy 2 Sim
copy2sim Commented 10 mesi fa

The value of lunarDateinChinese, in this case, is represented in Unicode as “\u4e94\u6708\u5341\u4e8c”. To convert it into Chinese characters, you can utilize the following JavaScript code:

<script>
function convertUnicodeToChinese(unicode) {
var codeArray = unicode.split("\u");
var chinese = “”;

for (var i = 0; i < codeArray.length; i++) {
var code = codeArray[i];
if (code) {
chinese += String.fromCharCode(parseInt(code, 16));
}
}

return chinese;
}
// Example usage
var unicode = “\u4e94\u6708\u5341\u4e8c”; // Unicode representation of "五月十二"
var chineseText = convertUnicodeToChinese(unicode);
console.log(chineseText);
</script>

Rapid account: BTRTSIT
BTRTSIT Commented 10 mesi fa

xhr.open(‘GET’, ‘https://chinese-lunar-calendar.p.rapidapi.com/?date=’ + ConvertedDate + ‘&timezone=480&simplified=1’);
xhr.setRequestHeader(‘X-RapidAPI-Key’, ‘’);
xhr.setRequestHeader(‘X-RapidAPI-Host’, ‘chinese-lunar-calendar.p.rapidapi.com’);
xhr.setRequestHeader(‘OData-MaxVersion’, ‘4.0’);
xhr.setRequestHeader(‘OData-Version’, ‘4.0’);
xhr.setRequestHeader(‘Accept’, ‘application/json’);
xhr.setRequestHeader(‘Content-Type’, ‘application/json; charset=utf-8’);
xhr.onreadystatechange = function () {
if (this.readyState === 4) {
xhr.onreadystatechange = null;
if (this.status === 200) {
var result = JSON.parse(this.response);
//json.decode(utf8.decode(response.bodyBytes));

			var gmb_namechinese = result['lunarDateinChinese'];
			return gmb_namechinese;
		}
		else { }
	}
};
xhr.send(data);

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입