fix Chinese comment encoding error

This commit is contained in:
ETZhangSX 2021-03-23 12:00:11 +08:00 committed by ruanshudong
parent 01c00acd3e
commit a41082bc7e
3 changed files with 44 additions and 44 deletions

View File

@ -83,7 +83,7 @@ int main(int argc, char* argv[])
j2c.setCheckDefault(tars::TC_Common::lower(option.getValue("check-default")) == "false"?false:true);
try
{
//<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>tars<EFBFBD><EFBFBD>ͷ
// 是否可以以tars开头
g_parse->setTars(option.hasParam("with-tars"));
g_parse->setHeader(option.getValue("header"));

View File

@ -343,7 +343,7 @@ string Tars2C::generateH(const StructPtr &pPtr, const string& namespaceId) const
s << TAB << "Int32 (*writeTo)( const "<<sStructName<<"*, TarsOutputStream *);" << endl;
s << TAB << "Int32 (*readFrom)( "<<sStructName<<"*, TarsInputStream *);" << endl;
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// 定义成员变量
vector<TypeIdPtr>& member = pPtr->getAllMemberPtr();
for (size_t j = 0; j < member.size(); j++)
{
@ -374,7 +374,7 @@ string Tars2C::generateC(const StructPtr &pPtr, const string& namespaceId) const
ostringstream s;
string sStructName = namespaceId + "_" + pPtr->getId();
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// 定义成员变量
vector<TypeIdPtr>& member = pPtr->getAllMemberPtr();
////////////////////////////////////////////////////////////
@ -463,7 +463,7 @@ string Tars2C::generateC(const StructPtr &pPtr, const string& namespaceId) const
for (size_t j = 0; j < member.size(); j++)
{
BuiltinPtr bPtr = BuiltinPtr::dynamicCast(member[j]->getTypePtr());
//stringֵҪת<EFBFBD><EFBFBD>
// stringֵ 值要转义
if (bPtr && bPtr->kind() == Builtin::KindString)
{
s << TAB << "this->" << member[j]->getId() << " = JString_new();" << endl;
@ -537,7 +537,7 @@ string Tars2C::generateC(const StructPtr &pPtr, const string& namespaceId) const
for (size_t j = 0; j < member.size(); j++)
{
BuiltinPtr bPtr = BuiltinPtr::dynamicCast(member[j]->getTypePtr());
//stringֵҪת<EFBFBD><EFBFBD>
// string 值要转义
if (bPtr && bPtr->kind() == Builtin::KindString)
{
if (member[j]->hasDefault())
@ -758,7 +758,7 @@ StructPtr Tars2C::findStruct(const ContextPtr &pPtr,const string &id)
{
string sid = id;
//<EFBFBD>ڵ<EFBFBD>ǰnamespace<EFBFBD>в<EFBFBD><EFBFBD><EFBFBD>
// 在当前namespace中查找
vector<NamespacePtr> namespaces = pPtr->getNamespaces();
for (size_t i = 0; i < namespaces.size(); i++)
{

View File

@ -24,29 +24,29 @@
using namespace tars;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>tars<EFBFBD><EFBFBD><EFBFBD><EFBFBD>c<EFBFBD>ļ<EFBFBD>
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Proxy<EFBFBD><EFBFBD>Servant
* tars生成c文件
* Proxy和Servant
*/
class Tars2C
{
public:
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* @param file
*/
void createFile(const string &file);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>Ŀ¼
*
*
*/
void setBaseDir(const std::string & sPath) { m_sBaseDir = sPath; }
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵ
*
*
* @author kevintian (2010-10-8)
*
@ -54,11 +54,11 @@ public:
*/
void setCheckDefault(const bool bCheck) { m_bCheckDefault = bCheck; }
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DZ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//下面是编解码的源码生成
protected:
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>͵Ľ<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -66,7 +66,7 @@ protected:
string writeTo(const TypeIdPtr &pPtr,const string& namespaceId = "") const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>͵ı<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -89,10 +89,10 @@ protected:
*/
string displaySimple(const TypeIdPtr &pPtr, bool bSep) const;
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// 下面是类型描述的源码生成
protected:
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -100,14 +100,14 @@ protected:
string tostr(const TypePtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
*/
string tostrBuiltin(const BuiltinPtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>vector<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* vector的字符串描述
* @param pPtr
*
* @return string
@ -115,7 +115,7 @@ protected:
string tostrVector(const VectorPtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>map<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* map的字符串描述
* @param pPtr
*
* @return string
@ -123,7 +123,7 @@ protected:
string tostrMap(const MapPtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD>ֽ<EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -132,7 +132,7 @@ protected:
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD>ö<EFBFBD>ٵķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -140,7 +140,7 @@ protected:
string tostrEnum(const EnumPtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD>ɽӿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -150,7 +150,7 @@ protected:
string toClassName(const TypePtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -158,17 +158,17 @@ protected:
string decode(const TypeIdPtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
*/
string encode(const TypeIdPtr &pPtr) const;
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>h<EFBFBD><EFBFBD>c<EFBFBD>ļ<EFBFBD><EFBFBD>ľ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// 以下是h和c文件的具体生成
protected:
/**
* <EFBFBD><EFBFBD><EFBFBD>md5
* md5
* @param pPtr
*
* @return string
@ -176,7 +176,7 @@ protected:
string MD5(const StructPtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -184,7 +184,7 @@ protected:
string generateH(const StructPtr &pPtr, const string& namespaceId) const;
/**
* <EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><EFBFBD>cpp<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* cpp文件内容
* @param pPtr
*
* @return string
@ -192,7 +192,7 @@ protected:
string generateC(const StructPtr &pPtr, const string& namespaceId) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>Դ<EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -200,7 +200,7 @@ protected:
string generateH(const ContainerPtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* c源码
* @param pPtr
*
* @return string
@ -208,7 +208,7 @@ protected:
string generateCpp(const ContainerPtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -233,7 +233,7 @@ protected:
//string generateAsyncResponseCpp(const OperationPtr &pPtr, const string &cn) const;
/**
* <EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>cpp<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* cpp文件内容
* @param pPtr
*
* @return string
@ -241,7 +241,7 @@ protected:
string generateCpp(const ParamDeclPtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>proxy<EFBFBD><EFBFBD>cpp<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* proxy的cpp文件内容
* @param pPtr
* @param cn
*
@ -250,7 +250,7 @@ protected:
string generateCpp(const OperationPtr &pPtr, const string &cn) const;
/**
* <EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>servant<EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>Դ<EFBFBD><EFBFBD>
* servant的头文件源码
* @param pPtr
* @param bVirtual
*
@ -259,7 +259,7 @@ protected:
string generateH(const OperationPtr &pPtr, bool bVirtual, const string& interfaceId) const;
/**
* <EFBFBD><EFBFBD><EFBFBD>ɽӿڵ<EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>Դ<EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -267,7 +267,7 @@ protected:
string generateH(const InterfacePtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD>Ľӿڵ<EFBFBD>cpp<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD>
* cpp文件的源码
* @param pPtr
*
* @return string
@ -275,7 +275,7 @@ protected:
string generateCpp(const InterfacePtr &pPtr, const NamespacePtr &nPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD>ٵ<EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>Դ<EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -283,7 +283,7 @@ protected:
string generateH(const EnumPtr &pPtr, const string& namespaceId) const;
/**
* <EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>Դ<EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -291,7 +291,7 @@ protected:
string generateH(const ConstPtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿռ<EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>Դ<EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -299,7 +299,7 @@ protected:
string generateH(const NamespacePtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿռ<EFBFBD>cpp<EFBFBD>ļ<EFBFBD>Դ<EFBFBD><EFBFBD>
* cpp文件源码
* @param pPtr
*
* @return string
@ -307,7 +307,7 @@ protected:
string generateC(const NamespacePtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿռ<EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>Դ<EFBFBD><EFBFBD>
*
* @param pPtr
*
* @return string
@ -315,7 +315,7 @@ protected:
void generateH(const ContextPtr &pPtr) const;
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿռ<EFBFBD>cpp<EFBFBD>ļ<EFBFBD>Դ<EFBFBD><EFBFBD>
* cpp文件源码
* @param pPtr
*
* @return string
@ -324,7 +324,7 @@ protected:
/**
*
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֲ<EFBFBD><EFBFBD>ҽ
*
* @param pPtr
* @param id
*
@ -336,7 +336,7 @@ protected:
/**
* <EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵ
*
*
* @author kevintian (2010-10-8)
*/