copy-as-rtf
copy-as-rtf copied to clipboard
It copy a lot of strange characters
Hi, I tried to use this package, but it didn't work to me.
I try this sample:
#include <stdio.h>
void main(){
//some sentence
}
But when I copy with the package, it paste this to me.
{\rtf1\ansi\uc0\deff0{\fonttbl{\f0\fmodern\fprq1\fcharset0 Monaco;}}{\colortbl;\red0\green0\blue0;\red78\green154\blue6;\red0\green0\blue207;\red143\green89\blue2;\red245\green121\blue0;\red32\green74\blue135;\red206\green92\blue0;\red248\green248\blue248;\red0\green160\blue0;\red52\green101\blue164;\red128\green0\blue128;\red164\green0\blue0;\red92\green53\blue204;\red239\green41\blue41;\red196\green160\blue0;\red0\green0\blue128;\red204\green0\blue0;}\f0 {\cf4\i #}{\cf4\i include <stdio.h>}{\cf4\i \par
}\par
{\cf6\b void} {\cf1 main}{\cf1\b (}{\cf1\b )}{\cf1\b \{}\par
{\cf4\i //some sentence\par
}{\cf1\b \}}\par
}
I'm using:
- UI Theme: Seti UI
- Syntax Theme: Solarized Dark
- Atom 0.194.0
Thanks a lot!
@charlynet7 that's the RTF format of the code you copied - if you paste it somewhere that supports RTF (instead of a plain text editor or something like that) it should paste the code with the proper syntax highlight.
Hi @lucasmazza , I actually paste it to Outlook or Word, and both support RTF, it work with the Notepad++ feature. And I do have the issue of #5 . Thanks.
+1 Paste to evernote which is supposed to support rtf.
I haven't replicated this issue so far, and I think it might be something very Windows specific. I don't have the right environment to test this out, so it would be very welcomed if someone else could track this down and fix it.
+1 for me. Is it possible to re-open the issue?
+1 - same bug here Arch Linux
, LibreOffice 5.0.4.2 00m0(Build:2)
It's OK for Mac and Windows now.
@tafkey It should be OK for Linux too since xclip
command is available in your system. Check it in a terminal. I will try to get an Arch Linux VM.
This issue occurs for me too. I use macOS Sierra (Japanese), Atom 1.16.0, copy-as-rtf 0.9.3. Original file format I copied is UTF-8. I paste to TextEdit (supports RTF).
May be, character code of \
(back slash) is wrong.
Sample
It is (U+00A5)
![2017-04-21 18 36 09](https://cloud.githubusercontent.com/assets/1546218/25272087/7e8f48c4-26c1-11e7-9ca4-141fa18e7c8a.png)
{¥rtf1¥ansi¥uc0¥deff0{¥fonttbl{¥f0¥fmodern¥fprq1¥fcharset0 Monaco;}}{¥colortbl;¥red0¥green0¥blue0;¥red78¥green154¥blue6;¥red0¥green0¥blue207;¥red143¥green89¥blue2;¥red245¥green121¥blue0;¥red32¥green74¥blue135;¥red128¥green0¥blue128;¥red206¥green92¥blue0;¥red248¥green248¥blue248;¥red0¥green160¥blue0;¥red52¥green101¥blue164;¥red164¥green0¥blue0;¥red92¥green53¥blue204;¥red239¥green41¥blue41;¥red196¥green160¥blue0;¥red0¥green0¥blue128;¥red204¥green0¥blue0;}¥f0 ¥fs32{¥cf1 pygmentize = }{¥cf1 require} {¥cf2 '}{¥cf2 pygmentize-bundled}{¥cf2 '}¥par
{¥cf1 copy = }{¥cf1 require} {¥cf2 '}{¥cf2 copy-paste}{¥cf2 '}¥par
{¥cf1 mapping = }{¥cf1 require} {¥cf2 '}{¥cf2 ./grammar-mapping}{¥cf2 '}¥par
}
It should be (U+005C)
![2017-04-21 18 36 23](https://cloud.githubusercontent.com/assets/1546218/25272094/8397a85c-26c1-11e7-9d66-985654289396.png)
{\rtf1\ansi\uc0\deff0{\fonttbl{\f0\fmodern\fprq1\fcharset0 Monaco;}}{\colortbl;\red0\green0\blue0;\red78\green154\blue6;\red0\green0\blue207;\red143\green89\blue2;\red245\green121\blue0;\red32\green74\blue135;\red128\green0\blue128;\red206\green92\blue0;\red248\green248\blue248;\red0\green160\blue0;\red52\green101\blue164;\red164\green0\blue0;\red92\green53\blue204;\red239\green41\blue41;\red196\green160\blue0;\red0\green0\blue128;\red204\green0\blue0;}\f0 \fs32{\cf1 pygmentize = }{\cf1 require} {\cf2 '}{\cf2 pygmentize-bundled}{\cf2 '}\par
{\cf1 copy = }{\cf1 require} {\cf2 '}{\cf2 copy-paste}{\cf2 '}\par
{\cf1 mapping = }{\cf1 require} {\cf2 '}{\cf2 ./grammar-mapping}{\cf2 '}\par
}