By Theink on Tag:

ตอนนี้กำลังศึกษา Ajax อยู่ครับ พอดีตอนที่ดึง ข้อความมาแสดงใน dropdown เมนูมันขึ้นเป็นภาษาต่างดาว พอมีใครแนะนำได้บ้างไหมครับ

ขอบคุณครับ

Hiring! บริษัทที่น่าสนใจ

Carmen Software company cover
Carmen Software
Hotel Financial Solutions
Next Innovation (Thailand) Co., Ltd. company cover
Next Innovation (Thailand) Co., Ltd.
We are web design with consulting & engineering services driven the future stronger and flexibility.
KKP Dime company cover
KKP Dime
KKP Dime บริษัทในเครือเกียรตินาคินภัทร
Kiatnakin Phatra Financial Group company cover
Kiatnakin Phatra Financial Group
Financial Service
Fastwork Technologies company cover
Fastwork Technologies
Fastwork.co เว็บไซต์ที่รวบรวม ฟรีแลนซ์ มืออาชีพจากหลากหลายสายงานไว้ในที่เดียวกัน
Thoughtworks Thailand company cover
Thoughtworks Thailand
Thoughtworks เป็นบริษัทที่ปรึกษาด้านเทคโนโยลีระดับโลกที่คว้า Great Place to Work 3 ปีซ้อน
Iron Software company cover
Iron Software
Iron Software is an American company providing a suite of .NET libraries by engineer for engineers.
CLEVERSE company cover
CLEVERSE
Cleverse is a Venture Builder. Our team builds several tech companies.
Nipa Cloud company cover
Nipa Cloud
#1 OpenStack cloud provider in Thailand with our own data center and software platform.
Bangmod Enterprise company cover
Bangmod Enterprise
The leader in Cloud Server and Hosting in Thailand.
CIMB THAI Bank company cover
CIMB THAI Bank
MOVING FORWARD WITH YOU - CIMB is the leading ASEAN Bank
Bangkok Bank company cover
Bangkok Bank
Bangkok Bank is one of Southeast Asia's largest regional banks, a market leader in business banking
MuvMi (Urban Mobility Tech Co.,Ltd.) company cover
MuvMi (Urban Mobility Tech Co.,Ltd.)
Shape the future of urban mobility towards affordable, clean, and safe solutions
T.N. Digital Solution Co., Ltd. company cover
T.N. Digital Solution Co., Ltd.
TNDS has been involving in every first move of banking’s major digital transformation.
KBTG - KASIKORN Business-Technology Group company cover
KBTG - KASIKORN Business-Technology Group
KBTG - "The Technology Company for Digital Business Innovation"
Siam Commercial Bank Public Company Limited company cover
Siam Commercial Bank Public Company Limited
"Let's start a brighter career future together"
Icon Framework co.,Ltd. company cover
Icon Framework co.,Ltd.
Global Standard Platform for Real Estate แพลตฟอร์มสำหรับธุรกิจอสังหาริมทรัพย์ครบวงจร มาตรฐานระดับโลก
REFINITIV company cover
REFINITIV
The Financial and Risk business of Thomson Reuters is now Refinitiv
H LAB company cover
H LAB
Re-engineering healthcare systems through intelligent platforms and system design.
The Gang Technology Co., Ltd. company cover
The Gang Technology Co., Ltd.
We're a Digital Agency that helps our customers transform their business into digital with ease.
LTMH company cover
LTMH
LTMH มุ่งเน้นการพัฒนาผลิตภัณฑ์ที่สามารถช่วยพันธมิตรของเราให้บรรลุเป้าหมาย
Seven Peaks company cover
Seven Peaks
We Drive Digital Transformation
Wisesight (Thailand) Co., Ltd. company cover
Wisesight (Thailand) Co., Ltd.
The Best Choice For Handling Social Media · High Expertise in Social Data · Most Advanced and Secure
MOLOG Tech company cover
MOLOG Tech
We are Modern Logistic Platform, Specialize in WMS, OMS and TMS.
Data Wow Co.,Ltd company cover
Data Wow Co.,Ltd
We enable our clients to realize increased productivity by solving their most complex issues by Data
LINE Company Thailand company cover
LINE Company Thailand
LINE, the world's hottest mobile messaging platform, offers free text and voice messaging + Call
LINE MAN Wongnai company cover
LINE MAN Wongnai
Join our journey to becoming No.1 food platform in Thailand

lew Mon, 29/05/2006 - 02:32

เจอบ่อยๆ ครับ ไม่ใช่แค่กับ AJAX แต่กับ Javascript ทั้งหมดน่ะครับ

หลักๆ เลยที่เป็นกันบ่อยๆ ถ้าไม่ใช่ฝั่ง server-side ก็จะเป็นตรงฟังก์ชั่น encode/decode ครับ

วิธีแก้ที่ง่ายที่สุดคือเปลี่ยนฟังก์ชั่นพวกนี้ให้กลายเป็น encodeURIComponent/decodeURIComponent ก็น่าจะใช้ได้ทันที ถ้าไม่ได้ไปเล่นแผลงๆ อย่างอื่น

ipats Mon, 29/05/2006 - 13:39

วิธีที่ผมแก้ง่ายๆ คือ ใช้ UTF-8 ทั้งหมดอ่ะครับ ทั้งตัวไฟล์ ดาต้าเบส ข้อมูลที่ส่งไปกลับ ฯลฯ

ปล. ตอนนี้ผมใช้ sajax อ่ะครับ เนื่องจากขี้เกียจเขียนส่วนจัดการเอง

lew Mon, 29/05/2006 - 14:05

ipats - ฟังก์ชั่น encode/decode มันไม่รับ utf8 น่ะครับ ต่อให้ใช้ utf8 ก็เดี๊ยงอยู่ดี

Theink Sat, 03/06/2006 - 23:33

Ok สุดท้าย ผมค้นพบวิธีแล้วอย่างที่ ipats บอกครับ "ทุกอย่างเป็น utf8" code php ที่เขียนก็ต้องเซฟเป็น utf8 ไม่ใช่ ansi meta Content-Type ก็ด้วย แน่นอนแม้แต่ database ครับ

softganz Mon, 23/10/2006 - 01:29

อ่านเจอมาจากในพันทิพย์ เขาบอกว่าให้เอาโค้ดข้างล่าง ไปใส่ไว้บนหัวของโปรแกรมส่วนที่ AJAX เรียกมาแสดงผล

<?php header ("Content-Type: text/html; charset=tis-620"); ?>

ผมลองแล้ว ใช้ได้เลยครับ

bow_der_kleine Mon, 23/10/2006 - 13:31

softganz : หากตัว html เป็น utf-8 ให้ใช้ <?php header ("Content-Type: text/html; charset=utf-8"); ?> ครับ

Pop Sat, 21/04/2007 - 23:14

แต่ใน Firefox ไม่มีปัญหาครับ

function ascii_unicode_thai($text_input) { $text_output = ""; for ($i=0;$i if (ord($text_input[$i])<=126) $text_output .= $text_input[$i]; else $text_output .= "&#".(ord($text_input[$i])-161+3585).";"; } return $text_output; }

echo แล้วได้เลยคับ

iake Sun, 22/04/2007 - 08:35

เคยเจอปัญหานี้กับตัวเองเหมือนกันครับ เมื่อดึงข้อมูลมามันขึ้นเป็นกล่องสี่เหลี่ยม พอใช้ encodeURIComponent decodeURIComponent ก็หาย

--------- http://iake.blogspot.com

buachompoo Tue, 29/05/2007 - 05:12

ใครเคยเจอเวลาใช้ UTF-8 แล้ว ตัว ภ. กลายเป็น กล่องสี่เหลี่ยม แค่เพียงตัวเดียวบ้างมั้ยคะ ส่วนตัวอักษรตัวอื่น ปกติทุกอย่าง

--------------------------------------------------- เนื้อเพลง คอร์ดเพลง ที่ Music Lyrics Chord ค่ะ