Javascript 在谷歌工作表中插入重音字符?

Javascript 在谷歌工作表中插入重音字符?,javascript,google-sheets,gdata-api,google-spreadsheet-api,Javascript,Google Sheets,Gdata Api,Google Spreadsheet Api,我正在使用以下方法将数据插入Google工作表: var row = new RowWork(null, null, { column1: col1, column2: col2, }); this.GData.postEntry(row); 及 toAtom:function(){ 返回“”+ ''+ ''+ ''; } postEntry:函数(行) { var req=新的XMLHttpRequest(); var atom=row.toAtom(); 请求打开('PO

我正在使用以下方法将数据插入Google工作表:

var row = new RowWork(null, null, {
    column1: col1,
    column2: col2,
});

this.GData.postEntry(row);

toAtom:function(){
返回“”+
''+
''+
'';
}
postEntry:函数(行)
{
var req=新的XMLHttpRequest();
var atom=row.toAtom();
请求打开('POST',row.editurl,false);
req.setRequestHeader('Authorization','GoogleLogin auth='+ClientLogin.token);
请求setRequestHeader('GData-Version','3.0');
setRequestHeader('Content-Type','application/atom+xml;charset=utf-8');
请求setRequestHeader('Content-Length',atom.Length);
请求setRequestHeader('Connection','close');
请求发送二进制(原子);

如果(!req.responseText.match(/^使用
replace
函数将文字转换为其等效的XML实体:

var atom = row.toAtom().replace(/é/g, "é");
参考资料


您使用的是谷歌应用程序脚本吗?您有正确的问题标签吗?我使用的是谷歌API“谷歌API”?…您使用的是:或者我对名称有点困惑,是Gdata…我用Java Gdata 3,0 API(谷歌电子表格API)试过了.而且读写都很好。我使用java编码,使用\u00E9,所以不知道为什么会出现问题,因为我认为它们都使用相同的协议…我猜,如果编码正确,它确实有效。
var atom = row.toAtom().replace(/é/g, "é");