是否有任何庫可用於解碼Silverlight上的Shift JIS文本?在Silverlight上有沒有用於Shift JIS編碼的庫?
-1
A
回答
2
我能端口Mono的實施,.NET在不到一個小時。這是(最少?)組類需要移植(由依賴排序):
I18N.Common.Strings
I18N.Common.MonoEncoding
I18N.CJK.CodeTable
I18N.CJK.DbcsConvert
I18N.CJK.DbcsEncoding
I18N.CJK.JISConvert
I18N.CJK.CP932
此外,以下文件需要被複制(裝載在I18N.CJK.CodeTable
構造):
一個實現 「shift_jis訪問」 編碼是I18N.CJK.CP932
的類。請注意,它必須手動實例化,不是到Encoding.GetEncoding()
。
-1
我發現了一些信息在這裏:
http://www.eggheadcafe.com/community/aspnet/14/14621/covert-shiftjis-to-unicode.aspx
這是從上面(學分彼得布朗伯格)的鏈接是C#示例代碼。我無法確定它會在Silverlight中工作。我想這一切都取決於是否Encoding.GetEncoding(「SJIS」)是SL提供:
public class FileConverter
{
const int BufferSize = 8096;
public static void Main(string[] args)
{
if (args.Length != 2)
{
Console.WriteLine
("Usage: FileConverter <input file> <output file>");
return;
}
//NOTE: you may need to use " Encoding enc = Encoding.GetEncoding("shift-jis"); " for non-standard code pages
// Open a TextReader for the appropriate file
using (TextReader input = new StreamReader
(new FileStream (args[0], FileMode.Open),
Encoding.UTF8))
{
// Open a TextWriter for the appropriate file
using (TextWriter output = new StreamWriter
(new FileStream (args[1], FileMode.Create),
Encoding.Unicode))
{
// Create the buffer
char[] buffer = new char[BufferSize];
int len;
// Repeatedly copy data until we've finished
while ((len = input.Read (buffer, 0, BufferSize)) > 0)
{
output.Write (buffer, 0, len);
}
}
}
}
}
相關問題
- 1. 解碼Android中的shift-jis
- 2. 在eclipse中使用Shift-jis
- 3. Smarty的 - SHIFT-JIS編碼,而無需使用PHP
- 4. 字符串編碼轉換UTF-8爲Shift-JIS使用
- 5. 在Shift JIS cp392編碼中無法讀取文本文件
- 6. 如何將Shift-JIS編碼的字符串轉換爲UTF-8?
- 7. 從freetype(SHIFT JIS編碼)檢索指定的字形?
- 8. Shift-JIS解碼在Visual C++ 2013中使用wifstrem失敗
- 9. Delphi:從windows-1251轉換到Shift-JIS
- 10. TextOut()和Shift-JIS(日文字符)
- 11. Shift-JIS是否可以包含零?
- 12. 有沒有讓你在iPhone上編碼的應用程序(不適用於iphone)?
- 13. Java編寫按住Shift JIS CSV格式文件
- 14. 在Oracle 11g上沒有編碼的Xml
- 15. 有沒有DataGrids Silverlight的開源代碼?
- 16. 沒有數據可用於編碼936
- 17. 有沒有用於將C#類庫轉換爲Silverlight庫的工具?
- 18. Unicode上線(U + 203E)意外轉換爲Shift-JIS
- 19. 我想糾正PHPLIST上的SHIFT-JIS和UTF-8外文字體的PHP編碼問題
- 20. 爲什麼沒有String#shift()?
- 21. 有沒有用於生成Python源代碼的庫?
- 22. C#編碼移位-JIS與UTF8 HTML敏捷包
- 23. 編碼從JIS X 208到UNICODE的轉換
- 24. 如何使用Shift-JIS和CP932創建SQL注入攻擊?
- 25. 沒有硬編碼
- 26. 在Windows上沒有默認的字節碼編譯Python代碼?
- 27. AVI沒有編碼的MP4
- 28. 沒有XML編碼的SQLXML?
- 29. kaazing ...有沒有人用Silverlight試用它?
- 30. 有沒有辦法在XSLT上強制讀取編碼?
謝謝,但不,它不起作用,因爲Silverlight中沒有「shift-jis」編碼。顯然,Silverlight中只有UTF-8和UTF-16編碼可用。 – 2011-02-17 16:37:14