我有一个使用确认服务的组件,如下所示
@Component({
moduleId: module.id,
templateUrl: 'account-list.component.html',
providers: [AccountService],
selector: 'account-list'
}).....
deleteAccount(Account: Account) {
this.confirmationService.confirm({
header: 'Delete Confirmation', message: 'Are you sure that you want to delete this account?',
icon: 'fa fa-trash',
accept: () => {
this.AccountService.deleteAccount(Account.account_id).subscribe(
res => {
let index: number = this.Accounts.findIndex(n => n.account_id === Account.mc_account_id);
if (~index) {
this.Accounts.splice(index, 1);
}
this.msgs.push({ severity: 'Info', summary: 'The account is deleted' });
},
err => {
this.msgs.push({ severity: 'Error', summary: err.message });
}
);
}
});
}
Run Code Online (Sandbox Code Playgroud)
这个组件可以单独使用.将此组件用作子组件时,将触发两次确认服务.即当我想删除一个对象时,我需要多次点击接受或拒绝按钮. …
我有 UTF-16 十六进制表示,例如 \xe2\x80\x9c0633064406270645\xe2\x80\x9d ,即阿拉伯语中的“\xd8\xb3\xd9\x84\xd8\xa7\xd9\x85”。
\n\n我想将其转换为其等效文本。在 PostgreSQL 中有直接的方法可以做到这一点吗?
\n\n我可以像下面这样转换 UTF 代码点;不幸的是,似乎不支持 UTF16。关于如何在 PostgreSQL 中执行此操作的任何想法,最坏的情况我会编写一个函数?
\n\nSELECT convert_from (decode (E\'D8B3D984D8A7D985\', \'hex\'),\'UTF8\');\n\n"\xd8\xb3\xd9\x84\xd8\xa7\xd9\x85"\n\nSELECT convert_from (decode (E\'0633064406270645\', \'hex\'),\'UTF16\');\n\nERROR: invalid source encoding name "UTF16"\n********** Error **********\nRun Code Online (Sandbox Code Playgroud)\n