ALM Team Foundation Server
▌背景
同事反應由TFS送出的Email通知信,在Confidentiality Notice (保密通知)的中文字會變成亂碼。
一開始以為是需要到Relay Mail Server做編碼設定, 不過詢問MIS其他系統並無此問題。
所以又將元凶指向Team Foundation
Server的設定。
l Windows Server 2008
R2
l Team Foundation
Server 2013 update 5
▌解決方式
昨天找了一下,都沒有相關的解法。
但是今天一到辦公室,第一個下的查詢關鍵字終於被我找到解法了!!
果然“下對關鍵字”也是IT很重要的技能之一啊!!!
請參考此討論文章:
以下節錄自上面的討論串:
The XslCompiledTransform being
used under the covers is injecting the unwanted meta tag into the email
body output. Presumably the charset is derived from the source
document. And, evidently, the XSLT specification mandates that XSLT
processors add a meta element with content type and charset in the head
section when serializing the result tree if either (or both) of the
following are true:
- the root element of the result tree has the
local name html with no namespace
- the stylesheet has <xsl:output method="html" /> (as
TeamFoundation.xsl does, indeed!)
Therefore, I changed my
stylesheets to <xsl:output
method="xml" /> and all is well!
Files edited:
- %ProgramFiles%\Microsoft Team Foundation
Server 11.0\Application
Tier\TFSJobAgent\Transforms\TeamFoundation.xsl
- %ProgramFiles%\Microsoft Team Foundation
Server 11.0\Application
Tier\TFSJobAgent\Transforms\1033\TeamFoundation.xsl
|
▋調整TeamFoundation.xsl
以TFS2013為例,請用文字檔開啟以下兩個檔案:
C:\Program
Files\Microsoft Team Foundation Server 12.0\Application Tier\TFSJobAgent\Transforms\TeamFoundation.xsl
C:\Program
Files\Microsoft Team Foundation Server 12.0\Application
Tier\TFSJobAgent\Transforms\1028\TeamFoundation.xsl
將 <xsl:output
method="html"/>
調整為 <xsl:output
method="xml"/> 即可。
此時可看到TFS送出的Email中的 Confidentiality Notice 已可正常顯示中文:
|
|
沒有留言:
張貼留言