开发者

How can I properly display Vietnamese characters in ColdFusion?

I having a hard trying to properly display Vietnamese text in ColdFusion. I've proper charset set to UTF-8 but still no luck. The same text开发者_JAVA技巧s work fine in a HTML page. What else am I missing? Any suggestion would be much appreciated.

Html:

How can I properly display Vietnamese characters in ColdFusion?

ColdFusion:

How can I properly display Vietnamese characters in ColdFusion?

Thanks!


There are two things you need to watch out for, as far as I recall of the top of my head.

The first is to ensure that the .cfm file itself is saved as UTF-8 - this is a file system option, and will probably be settable in your editor. This ensures that the UTF-8 characters are correctly preserved when saving the file.

The other is that every .cfm file that includes any UTF-8 text should start with:

<cfprocessingdirective pageencoding="utf-8" />

This ensures that ColdFusion delivers the page to the browser in the correct format.


Just to be sure, when you display your working HTML, can you check the page encoding used by your browser (ie. in FireFox you can right-click+page Info). Maybe your text is not UTF-8 encoded that could explain the problem...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜