IronPythonã®ã¹ã¯ãªããã®ã¨ã³ã³ã¼ãã£ã³ã°å¤å®ããããã件
IronPythonã§Silverlightéçºãã¯ãããã¨ããããã©ããã¹ã¯ãªããã®ã¨ã³ã³ã¼ãæå®ï¼# -*- coding: utf-8 -*- ã¨ãï¼ã®ããããããããã¨æã£ã¦ããã©ãè¯ãããªæ å ±ãã¿ã¤ããã
IronPython2.0B5 ã® Src/IronPython/Runtime/PythonContext.cs ããããã°ãã¦ã¿ã¦åãã£ããã¨ã§ããã©ãã¹ã¯ãªããã«ã¨ã³ã³ã¼ãã£ã³ã°ãæå®ããå ´åã®PythonContext.GetSourceReaderã®åä½ãåå ã§ã以ä¸ã®åé¡ãçãã¾ãã
http://homepage3.nifty.com/yamakox/Scrabbles/index.html
- BOMãä»ããUTF-8ã®ã¹ã¯ãªããã®å ´åãTokenizer.TryGetEncodingã®è¿ãã¨ã³ã³ã¼ãã£ã³ã°ãç¬èªã® StringOps.EncodingWrapperã«ãªã£ã¦ãã¾ããsr.CurrentEncodingã®UTF8Encodingã¨ä¸è´ããªããªã£ã¦"file has both Unicode marker and PEP-263 file encoding"ã¨ã©ã¼ã«ãªã
- BOMãä»ããUTF-16ã®ã¹ã¯ãªããã®å ´åãstream.Seek(bytesRead, SeekOrigin.Begin)ã®bytesReadã®å¤ãå®ã¯charåä½ã®æ°å¤ã«ãªã£ã¦ãããããã·ã¼ã¯ããä½ç½®ãæ£ãããªã (PythonContext.ReadOneLineã§sr.Readã®æ»ãå¤ãbytesReadå¤æ°ã«å ¥ãã¦ãããã¨ããããã)
- BOMã®ãªãUTF-16ã¹ã¯ãªããã¯sr.CurrentEncodingãPythonAsciiEncodingãªã®ã§ coding: ãå¤å¥ã§ããªã
- ä¸è¨ä»¥å¤ã®å ´åãcoding: è¡ãstream.Seek(bytesRead, SeekOrigin.Begin)ã§ã¹ããããã¦ãã¾ããããã¹ã¯ãªããã®Parserã¯1è¡ç®ã¾ãã¯2è¡ç®ãç¥ããªãã§ã¹ã¯ãªãããèªã¿è¾¼ãã§ãã¾ããPythonã¹ã¯ãªãããVisual Studioã®ãããã¬ã§ãããã°ããã¨å®éã®åæ¢ä½ç½®ã¨ç°ãªãè¡ããã¤ã©ã¤ã表示ã«ãªã(é»è²ãæã¾ã)
ãã®ãã¼ã¸ããªã³ã¯æ§é ãããã¾ããããªããªâ¦ãä¸ã®å¼ç¨å
ã®URLã¯ãã®ãã¡ä»¥ä¸ã®URLã«ç§»åããããã
http://homepage3.nifty.com/yamakox/Scrabbles/200809.html
ãªã³ã¯æ§é ã¯ã¨ãããã¨ãã¦ãä»å¾ã®äºãèããä¸ã§ç¾ç¶å¦¥å½ãããªæ¹æ³ã¯ä»¥ä¸ã«ãªããâ¦ã
- ã¹ã¯ãªãã㯠UTF-8N åºå®
- ã¹ã¯ãªããã®å é ã« # -*- coding: utf-8 -*-
- ã¨ã©ã¼æã«1è¡ããã¦éç¥ãããã®ã¯ã¨ã³ã¸ã³ãä¿®æ£ãããã¾ã§è«¦ãã