You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by 阿熊 <ni...@gmail.com> on 2009/08/10 10:59:26 UTC

charset problem with file Autogenerated by Thrift

hi everyone , i'm new to thrift,
i find maybe a problem with the thrift idl file
i wrote some struct comment in the idl file with chinese characters
(Non-ASCII character ).
then i use thrift generated the python code, it doesn't contains the
encoding set comment line:
# -*- coding: utf-8 -*-
when i try to run the serv code ,it's cause SyntaxError: Non-ASCII character
'\xxx' in file

is there some way to autogenerate the encoding setting comment line for
python?

Re: charset problem with file Autogenerated by Thrift

Posted by Bryan Duxbury <br...@rapleaf.com>.
I would say the course of action here is to open a ticket for this  
issue in our JIRA (https://issues.apache.org/jira/browse/THRIFT), and  
if you feel energetic, make us a patch to add this functionality as a  
command line option or something like that. Thanks for making us  
aware of this internationalization issue!

-Bryan

On Aug 10, 2009, at 1:59 AM, 阿熊 wrote:

> hi everyone , i'm new to thrift,
> i find maybe a problem with the thrift idl file
> i wrote some struct comment in the idl file with chinese characters
> (Non-ASCII character ).
> then i use thrift generated the python code, it doesn't contains the
> encoding set comment line:
> # -*- coding: utf-8 -*-
> when i try to run the serv code ,it's cause SyntaxError: Non-ASCII  
> character
> '\xxx' in file
>
> is there some way to autogenerate the encoding setting comment line  
> for
> python?