http://d.puremagic.com/issues/show_bug.cgi?id=6085


kenn...@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #2 from kenn...@gmail.com 2011-06-01 02:17:14 PDT ---
The reason of corrupted output is because of a wrong signature. 




diff --git a/src/rt/util/utf.d b/src/rt/util/utf.d
index d7aeac1..cdbc27c 100644
--- a/src/rt/util/utf.d
+++ b/src/rt/util/utf.d
@@ -28,7 +28,7 @@
 module rt.util.utf;


-extern (C) void onUnicodeError( string msg, size_t idx );
+extern (C) void onUnicodeError( string msg, size_t idx, string file =
__FILE__, size_t line = __LINE__ );

 /*******************************
  * Test if c is a valid UTF-32 character.




This patch, however, only gives the __FILE__ and __LINE__ of the druntime
function, not the actual user code that emits the error.  But I think this
can't be fixed without modifying DMD because _aApplycd1 doesn't contain the
line information.



core.exception.UnicodeException@src/rt/util/utf.d(290): invalid UTF-8 sequence
----------------
5   x                                   0x000096b2 onUnicodeError + 66
6   x                                   0x000151ce dchar
rt.util.utf.decode(const(char[]), ref uint) + 390
7   x                                   0x000121f4 _aApplycd1 + 68
8   x                                   0x000027e5 _Dmain + 37

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to