久久久久久久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(使用線程逐塊處理文件)
主站蜘蛛池模板: 免费在线看a| 青青草久久 | 一级片aa | 四虎影院在线播放 | 国产h在线观看 | 国产xxx | 成人国产精品视频 | 色婷婷综合在线 | 午夜看看 | 亚洲欧美另类在线观看 | 久久久精品一区二区三区 | 亚洲国产精 | 亚洲网站在线 | 香蕉视频一区二区 | 精品久久久久久久久久久 | 一区二区高清 | 99视频网站 | 毛片在线免费 | 日韩精品久久久久久 | 欧美激情精品 | 精品视频免费在线观看 | 久久99精品久久久久久 | 日本美女一级片 | 亚洲第一免费视频 | 日韩小视频在线观看 | 特级西西444www大精品视频 | 亚洲国产精品久久久 | 午夜aaa | 曰本一级片 | 91精品国产色综合久久不卡98 | 日韩精品三区 | 久久天堂网| 久久精品视 | 国产视频一 | 久久视频免费在线观看 | 中文字幕精品在线 | 午夜免费小视频 | 亚洲国产成人精品女人久久久 | 中文字幕在线观看一区二区三区 | 亚洲综合伊人 | 免费黄色小说网站 |