如何在VS Code的集成终端中正确显示unicode字符?

时间:2019-08-22 15:15:17

标签: java unicode visual-studio-code

按照标题,我似乎无法获得VS Code Integrated Terminal来正确显示unicode字符。它们始终在集成终端中显示为问号(?)。

我确保将文件保存为 UTF-8 编码,这似乎是迄今为止我所看到的所有答案中提出的唯一解决方案,但无济于事。

System.out.println("A unicode check mark character is supposed to look like this: \u2713");

预期输出:“ Unicode复选标记字符应如下所示:✓”

实际输出:“ Unicode复选标记字符应该看起来像这样:?”

2 个答案:

答案 0 :(得分:3)

在VS Code集成终端中,键入命令:extension OrderDetialsViewController: STPAddCardViewControllerDelegate { func addCardViewControllerDidCancel(_ addCardViewController: STPAddCardViewController) { print("addCard") navigationController?.popViewController(animated: true) } private func addCardViewController(_ addCardViewController: STPAddCardViewController, didCreateToken token: STPToken, completion: @escaping STPErrorBlock) { print("addCard Created Token") var totalCost = 0 for i in 0...localData.shoppingCart.itemSizeArray.count-1{ if localData.shoppingCart.itemSizeArray[i] == "hd"{ totalCost = totalCost+2000 } else if localData.shoppingCart.itemSizeArray[i] == "d"{ totalCost = totalCost+4000 } else if localData.shoppingCart.itemSizeArray[i] == "free"{ totalCost = totalCost + 0 } else if localData.shoppingCart.itemSizeArray[i] == "home" { totalCost = totalCost + 500 } } StripeClient.shared.completeCharge(with: token, amount: totalCost) { result in print("StripeClient") switch result { case .success: completion(nil) let alertController = UIAlertController(title: "Congrats on your order", message: "Your payment was successful! Check email for confirmation!", preferredStyle: .alert) let alertAction = UIAlertAction(title: "OK", style: .default, handler: { _ in self.navigationController?.popViewController(animated: true) }) alertController.addAction(alertAction) self.present(alertController, animated: true) self.createOrderEmailBody() self.createCustomerOrderBody() self.changeUserRewardsScore() case .failure(let error): print(error) completion(error) } } } } 然后应该正确显示unicode。

答案 1 :(得分:0)

由于 vscode 使用 xterm,你需要添加一个后备图标字体,比如我的 FontAwesome 是这样的:

"Cascadia Mono", "FontAwesome"

这会解决它

截图如下: enter image description here