Sure, I don't mind at all. I'm very glad you like them.-DeToX- wrote:T Beezie, those pictures are amazing. Do you mind if I use one for the main post?

Once again, outstanding job guys!
![]() |
![]() |
![]() |
Code: Select all
************** Exception Text **************
System.ArgumentException: The output char buffer is too small to contain the decoded characters, encoding 'Unicode (UTF-8)' fallback 'System.Text.DecoderReplacementFallback'.
Parameter name: chars
at System.Text.Encoding.ThrowCharsOverflow()
at System.Text.Encoding.ThrowCharsOverflow(DecoderNLS decoder, Boolean nothingDecoded)
at System.Text.UTF8Encoding.GetChars(Byte* bytes, Int32 byteCount, Char* chars, Int32 charCount, DecoderNLS baseDecoder)
at System.Text.DecoderNLS.GetChars(Byte* bytes, Int32 byteCount, Char* chars, Int32 charCount, Boolean flush)
at System.Text.DecoderNLS.GetChars(Byte[] bytes, Int32 byteIndex, Int32 byteCount, Char[] chars, Int32 charIndex, Boolean flush)
at System.Text.DecoderNLS.GetChars(Byte[] bytes, Int32 byteIndex, Int32 byteCount, Char[] chars, Int32 charIndex)
at System.IO.BinaryReader.InternalReadChars(Char[] buffer, Int32 index, Int32 count)
at System.IO.BinaryReader.ReadChars(Int32 count)
at Tdtl_Color_Value_Editor.H2Map.Halo2Map.ScanDependancysLoneIDsAndReflexives(Int32 TagIndex)
at Tdtl_Color_Value_Editor.Form1.ListBox1_SelectedIndexChanged(Object sender, EventArgs e)
at System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ListBox.set_SelectedIndex(Int32 value)
at Tdtl_Color_Value_Editor.Form1.OpenMapToolStripMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The application is attempting to scan the selected tag for deps, lones and reflexs.BEEF!!! wrote:at Tdtl_Color_Value_Editor.H2Map.Halo2Map.ScanDependancysLoneIDsAndReflexives(Int32 TagIndex)
To read the tagtype of a possible dep in the meta, they decided to use the .readChars(count) method.BEEF!!! wrote:at System.IO.BinaryReader.ReadChars(Int32 count)
Which resulted in this error.BEEF!!! wrote:System.ArgumentException: The output char buffer is too small to contain the decoded characters, encoding 'Unicode (UTF-8 )' fallback 'System.Text.DecoderReplacementFallback'.
Code: Select all
protected char[] chars;
public override char[] ReadChars(int count)
{
chars = new char[count];
for (int x = 0; x != count; x++) chars[x] = Convert.ToChar(this.ReadByte());
return chars;
}
How do you do that?Prey wrote:Here, I'll take it apart for you:
The application is attempting to scan the selected tag for deps, lones and reflexs.BEEF!!! wrote:at Tdtl_Color_Value_Editor.H2Map.Halo2Map.ScanDependancysLoneIDsAndReflexives(Int32 TagIndex)
To read the tagtype of a possible dep in the meta, they decided to use the .readChars(count) method.BEEF!!! wrote:at System.IO.BinaryReader.ReadChars(Int32 count)
Which resulted in this error.BEEF!!! wrote:System.ArgumentException: The output char buffer is too small to contain the decoded characters, encoding 'Unicode (UTF-8 )' fallback 'System.Text.DecoderReplacementFallback'.
Moral of the story? Never use the readChars(...) method! One might think that it would return the current chars from the current position in the stream. This is not true, because if at the current position is not a valid char, the binaryReader moves on through the stream until it finally finds a byte that IS.
You are getting the error because the reader reaches the end of the stream, and just keeps on trying to read![]()
A fix for this is to derive a class from the BinaryReader and override the method, heres what I use:
So until that is implemented, this application won't work.Code: Select all
protected char[] chars; public override char[] ReadChars(int count) { chars = new char[count]; for (int x = 0; x != count; x++) chars[x] = Convert.ToChar(this.ReadByte()); return chars; }
Infern0 wrote:You just shave the excess bush and burn the leftovers.