]> git.proxmox.com Git - mirror_novnc.git/blame - core/util/strings.js
Add encodeUTF8 function to core/util/strings.js
[mirror_novnc.git] / core / util / strings.js
CommitLineData
6d6f0db0
SR
1/*
2 * noVNC: HTML5 VNC client
80b078c4 3 * Copyright (C) 2019 The noVNC Authors
6d6f0db0
SR
4 * Licensed under MPL 2.0 (see LICENSE.txt)
5 *
6 * See README.md for usage and integration instructions.
7 */
8
80b078c4 9// Decode from UTF-8
2c5491e1 10export function decodeUTF8(utf8string) {
6d6f0db0 11 return decodeURIComponent(escape(utf8string));
8727f598 12}
80b078c4
SM
13
14// Encode to UTF-8
15export function encodeUTF8(DOMString) {
16 return unescape(encodeURIComponent(DOMString));
17}