# Using "DOpus.SetClip" to send UTF8 text to the clipboard will be garbl

**URL:** <https://resource.dopus.com/t/using-dopus-setclip-to-send-utf8-text-to-the-clipboard-will-be-garbl/36520>\
**Category:** Help & Support\
**Tags:** bug-report, vbscript\
**Created:** [August 27, 2020, 11:07am UTC](https://resource.dopus.com/t/using-dopus-setclip-to-send-utf8-text-to-the-clipboard-will-be-garbl/36520 "2020-08-27T11:07:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![qiuqiu](https://resource.dopus.com/user_avatar/resource.dopus.com/qiuqiu/32/55961_2.png) [@qiuqiu](https://resource.dopus.com/u/qiuqiu)\
**Post date:** [August 27, 2020, 11:07am UTC](https://resource.dopus.com/t/using-dopus-setclip-to-send-utf8-text-to-the-clipboard-will-be-garbl/36520/1 "2020-08-27T11:07:41Z")

</div>

Run in CLI

```auto
'Copy Content
FileName = "D:\Temp\test.pas"

Dim STools, TextBlob

Set STools = DOpus.Create.StringTools

With DOpus.FSUtil.OpenFile(FileName)
	Set TextBlob = .Read()
	.Close
End With

FileContent = STools.Decode(TextBlob, "UTF-8")
DOpus.output FileContent 'The log window output is normal
DOpus.SetClip FileContent
DOpus.output "========"
DOpus.output DOpus.GetClip("text") ' There is garbled code.

```

Select "Paste" in the background menu of the file list, the text file will be garbled

Adjusting "clipbord\_text\_encoding = utf8nobom" is also invalid

[test.zip](https://resource.dopus.com/uploads/short-url/1004CAe63ggSxCG0FJuHlr46avA.zip) (5.0 KB)

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [August 27, 2020, 11:17am UTC](https://resource.dopus.com/t/using-dopus-setclip-to-send-utf8-text-to-the-clipboard-will-be-garbl/36520/2 "2020-08-27T11:17:45Z")

</div>

It seems OK here:

 ![2020-08-27 13-16-11 Clipboard Image](https://resource.dopus.com/uploads/default/original/3X/f/a/fa063530a433e7c33752d0cf014fe3741edf7795.png)

---

<div class="post-metadata">

**Author:** ![qiuqiu](https://resource.dopus.com/user_avatar/resource.dopus.com/qiuqiu/32/55961_2.png) [@qiuqiu](https://resource.dopus.com/u/qiuqiu)\
**Post date:** [August 28, 2020, 12:37am UTC](https://resource.dopus.com/t/using-dopus-setclip-to-send-utf8-text-to-the-clipboard-will-be-garbl/36520/3 "2020-08-28T00:37:00Z")

</div>

I am using the simplified Chinese version of windos 10 (2004 19041.450). Is it related to the default encoding of the operating system?

**I think it is still the problem of dopus.setclip method**

 ![剪贴板图片 (2)](https://resource.dopus.com/uploads/default/original/3X/2/5/25e28f21827f8972a1dad055004774c848bad166.jpeg)

**Use the clipboard function provided by vbsedit**

![剪贴板图片 (3)](https://resource.dopus.com/uploads/default/original/3X/1/f/1f898e34b3cde011840a2f1df14d22f3f85ab8e0.jpeg)

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [August 28, 2020, 4:28pm UTC](https://resource.dopus.com/t/using-dopus-setclip-to-send-utf8-text-to-the-clipboard-will-be-garbl/36520/4 "2020-08-28T16:28:46Z")

</div>

> [@qiuqiu](#):
>
> I am using the simplified Chinese

I switched Windows to that and was able to reproduce the problem.

A fix will be in the next beta.

Thanks for the report and the extra details!
