Considering all Visual Studio 2008 new source code files have initial
unicode BOM characters, any diff of source files from a default VS
install should do.

I am surprised *anyone* that uses VS can use post-review.
I set up a new user on the latest RBTools and had them modify a
checked in file and run post-review.
post-review failed w/ the same error code.

I deleted their rbtools egg file and re-installed RBTools using the
following command:
easy_install -Z -U rbtools

I then went in to the rbtools postreview.py file, and changed:
        return content_type, content.encode('utf-8')
to:
        return content_type, content#.encode('utf-8')

The user's post-review worked fine after that.

Notably, this explains why *all* of my VS source file reviews have a
red rectangle boxing some token char(s) at the beginning of the
diff(s).
That is the BOM char that reviewboard doesn't like.
The post-review "utf8" patch was intended to remove those...but I
don't think removing them is the best solution.
It would be best if reviewboard itself could just display the unicode
chars, optionally without boxing them in a red rectangle.

It would also be nice if reviewboard diffs wouldn't put a red
rectangle around the initial BOM chars.
The existence of BOM chars is normal and should be gracefully/silently
ignored.
A red box indicates to me an error/warning of some sort.
If the BOM differs between the two files then that should be
gracefully indicated.

Pv

On Feb 26, 11:13 am, Christian Hammond <chip...@chipx86.com> wrote:
> Mine too. We really need some example diffs that break things so we can put
> them into the unit test suite and verify when we fix it that other diffs
> don't break.
>
> Christian
>
> --
> Christian Hammond - chip...@chipx86.com
> Review Board -http://www.reviewboard.org
> VMware, Inc. -http://www.vmware.com
>
>
>
> On Thu, Feb 25, 2010 at 1:03 PM, Pv <p...@swooby.com> wrote:
> > Sorry for the poor formatting (couldn't find how to edit the previous
> > post):
>
> >  >>> s = 'La Pe\xf1a'
> >  >>> print s
> >  La Pe±a
> >  >>> s.encode('utf8')
> >  Traceback (most recent call last):
> >    File "<stdin>", line 1, in <module>
> >  UnicodeDecodeError: 'ascii' codec can't decode byte 0xf1 in position
> > 5: ordinal not in range(128)
> >  >>> s.encode('utf8','ignore')
> >  Traceback (most recent call last):
> >    File "<stdin>", line 1, in <module>
> >  UnicodeDecodeError: 'ascii' codec can't decode byte 0xf1 in position
> > 5: ordinal not in range(128)
> >  >>> s.encode('utf8','replace')
> >  Traceback (most recent call last):
> >    File "<stdin>", line 1, in <module>
> >  UnicodeDecodeError: 'ascii' codec can't decode byte 0xf1 in position
> > 5: ordinal not in range(128)
> >  >>> u = unicode(s, 'utf8')
> >  Traceback (most recent call last):
> >    File "<stdin>", line 1, in <module>
> >    File "C:\Python25\lib\encodings\utf_8.py", line 16, in decode
> >      return codecs.utf_8_decode(input, errors, True)
> >  UnicodeDecodeError: 'utf8' codec can't decode bytes in position 5-6:
> > unexpected end of data
> >  >>> u = unicode(s, 'utf8', 'ignore')
> >  >>> u
> >  u'La Pe'
> >  >>> u = unicode(s, 'utf8', 'replace')
> >  >>> u
> >  u'La Pe\ufffd'
>
> > Pv
>
> > --
> > Want to help the Review Board project? Donate today at
> >http://www.reviewboard.org/donate/
> > Happy user? Let us know athttp://www.reviewboard.org/users/
> > -~----------~----~----~----~------~----~------~--~---
> > To unsubscribe from this group, send email to
> > reviewboard+unsubscr...@googlegroups.com<reviewboard%2bunsubscr...@googlegr 
> > oups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/reviewboard?hl=en

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Reply via email to