Chinese Lunar Calendar

פרמיום
על ידי copy2sim | מְעוּדכָּן 2 महीने पहले | Data
פּוֹפּוּלָרִיוּת

8.5 / 10

חֶבִיוֹן

439ms

רמת שירות

100%

Health Check

N/A

חזרה לכל הדיונים

lunarDateinChinese - Chinese Characters are not displayed in the Response

Rapid account: BTRTSIT
BTRTSIT
10 महीने पहले

{“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 महीने पहले

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 महीने पहले

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);

הצטרף לדיון - הוסף תגובה למטה:

התחבר / הירשם כדי לפרסם תגובות חדשות