Ejemplo n.º 1
0
        internal void WriteUTF8ResourceString(IntPtr pv, int offset, int size, bool asciiOnly)
        {
            if (_responseCodePage == CodePageUtils.CodePageUT8 || // response encoding is UTF8
                (asciiOnly && _responseCodePageIsAsciiCompat))    // ASCII resource and ASCII-compat encoding

            {
                _responseEncodingUsed = true;  // note the we used encoding (means that we need to generate charset=) see RAID#93415

                // write bytes directly
                if (_charBufferLength != _charBufferFree)
                {
                    FlushCharBuffer(true);
                }

                BufferResource(pv, offset, size);

                if (!_responseBufferingOn)
                {
                    _response.Flush();
                }
            }
            else
            {
                // have to re-encode with response's encoding -- use public Write(String)
                Write(StringResourceManager.ResourceToString(pv, offset, size));
            }
        }
Ejemplo n.º 2
0
 internal void WriteUTF8ResourceString(IntPtr pv, int offset, int size, bool asciiOnly)
 {
     if (!this._responseEncodingUpdated)
     {
         this.UpdateResponseEncoding();
     }
     if ((this._responseCodePage == 0xfde9) || (asciiOnly && this._responseCodePageIsAsciiCompat))
     {
         this._responseEncodingUsed = true;
         if (this._charBufferLength != this._charBufferFree)
         {
             this.FlushCharBuffer(true);
         }
         this.BufferResource(pv, offset, size);
         if (!this._responseBufferingOn)
         {
             this._response.Flush();
         }
     }
     else
     {
         this.Write(StringResourceManager.ResourceToString(pv, offset, size));
     }
 }