久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 ColdFusion 中規范化字符串

Normalize String in ColdFusion(在 ColdFusion 中規范化字符串)
本文介紹了在 ColdFusion 中規范化字符串的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試在 ColdFusion 中規范化字符串.

I'm trying to normalize a string in ColdFusion.

我想為此使用Java類java.text.Normalizer,因為據我所知CF沒有任何類似的功能.

I want to use the Java class java.text.Normalizer for this, as CF doesn't have any similar functions as far as I know.

這是我當前的代碼:

<cfset normalizer = createObject( "java", "java.text.Normalizer" ) />
<cfset string = "?é?è" />
<cfset string = normalizer.normalize(string, createObject( "java", "java.text.Normalizer$Form" ).NFD) />
<cfset string = ReReplace(string, "\p{InCombiningDiacriticalMarks}+", "") />
<cfoutput>#string#</cfoutput>

任何想法為什么它總是輸出 ?é?è 而不是規范化字符串?

Any ideas why it always outputs ?é?è and not a normalized string?

推薦答案

在 ColdFusion 中,與 Java 不同,您不需要在字符串文字中轉義反斜杠.您當前的正則表達式不會匹配不以反斜杠開頭的任何內容,因此不會發生替換.

In ColdFusion, unlike in Java, you don't need to escape backslashes in string literals. Your current regex will not match anything that does not start with a backslash, so no replacement happens.

除此之外,您的代碼完全正確,您可以看到輸出時字符串的長度是 8,而不是 4.這是 normalize 調用的效果.

Other than that, your code is perfectly correct and you can see that the length of the string is 8, not 4, at the time of the output. This is an effect of the normalize call.

但是,請記住,它仍然是原始字符串的等效表示,因此您無法從視覺上區分差異也就不足為奇了.這是正確的 Unicode 渲染.

However, remember that it is still an equivalent representation of the original string, and so it is not surprising that you cannot tell the difference visually. This is correct Unicode rendering in action.

這篇關于在 ColdFusion 中規范化字符串的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數據庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 四虎影院欧美 | 精品视频一区二区 | 亚洲毛片在线观看 | 999久久久久久久久6666 | 欧美日韩在线观看一区 | 蜜桃视频麻豆 | 欧美一级免费黄色片 | 91久久国产综合久久 | 一级免费毛片 | 国产精品久久久久久中文字 | 欧美激情亚洲天堂 | 99精品国产一区二区三区 | 国产精品日韩一区 | 夜夜久久 | 中文字幕乱码视频32 | 国产激情视频网址 | 久久99精品视频 | 在线国产视频观看 | 色婷婷综合久久久中字幕精品久久 | 欧美成人精品 | 久久国产精品一区二区 | 国产精品美女久久久久aⅴ国产馆 | 亚洲国产成人一区二区 | 伊人精品在线视频 | 亚洲欧洲精品成人久久奇米网 | 欧美视频在线播放 | 亚洲精品4 | 欧美国产日韩精品 | 欧美一级免费观看 | 久久性 | 一区在线视频 | 亚洲乱码一区二区三区在线观看 | 一本大道久久a久久精二百 国产成人免费在线 | 在线国产小视频 | 日韩二三区 | 久久久国产精品 | 成人影视网| 韩国精品在线观看 | 日韩精品在线看 | 国产精品99久久免费观看 | 亚洲精品www久久久久久广东 |