Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

result cannot copy #1036

Closed
baker0611 opened this issue Nov 29, 2017 · 21 comments
Closed

result cannot copy #1036

baker0611 opened this issue Nov 29, 2017 · 21 comments
Assignees
Labels

Comments

@baker0611
Copy link

  • MSSQL Extension Version:
  • VSCode Version:
  • OS Version:

Steps to Reproduce:

  1. select * from tables
  2. the result cannot copy
@MattIrv
Copy link
Contributor

MattIrv commented Nov 30, 2017

Thanks for your report. I'm not able to reproduce this, and am able to copy by selecting results in the query grid and then right-clicking and choosing copy or using the ctrl+c keyboard shortcut.

Could you provide more details about the steps you're taking to get this problem? Additionally, could you please provide your extension version, VS Code version, and OS version so that we can try to track this down? You can get the extension version by going to the extensions pane in VS Code and looking at the number next to the "mssql" extension, and the VS Code version by going to Help > About in the VS Code menu bar (or "Code > About Visual Studio Code" if you're on a Mac). Thanks!

@baker0611
Copy link
Author

baker0611 commented Dec 1, 2017

if there some chinese words, it dose not work.

  1. insert table(xxx) values('一二三四五')
    2.select * from table
    3.copy(i cann't copy)

@MattIrv
Copy link
Contributor

MattIrv commented Dec 1, 2017

Thanks for the update, though I still can't seem to reproduce it.

One note: Depending on your database collation you may have to insert Chinese characters as a unicode string with a leading N, like insert table(xxx) values(N'一二三四五'). If you're seeing it show up as ????? characters, this could be the problem. See https://support.microsoft.com/en-us/help/239530/you-must-precede-all-unicode-strings-with-a-prefix-n-when-you-deal-wit for more info

@baker0611
Copy link
Author

display normally, save as json,csv,excel all in good working, but the copy dose not work, i could not paste the reasult

@baker0611
Copy link
Author

baker0611 commented Dec 12, 2017

Is it solved? It should be something wrong of character encoding。 v1.18.1 (1.18.1)

@MattIrv
Copy link
Contributor

MattIrv commented Dec 12, 2017

Unfortunately we still haven't been able to reproduce it, but will keep looking at it. If there's any additional information about what sort of things you can or cannot copy, please let me know.

What operating system are you running when you get this error?

@MattIrv
Copy link
Contributor

MattIrv commented Dec 12, 2017

Update: I'm seeing this on Linux (Ubuntu) for all queries, not just ones that return unicode characters, and will look into it. Are you using Linux?

@MattIrv MattIrv self-assigned this Dec 12, 2017
@MattIrv
Copy link
Contributor

MattIrv commented Dec 12, 2017

On Linux, this is happening because we have an undocumented dependency on the utility xclip, which may not be installed by default.

As a workaround, you can install xclip through your Linux distribution's package manager (for example by running sudo apt install xclip on Ubuntu).

I will continue to look into how we can make copy/paste work on Linux without requiring users to install xclip.

@baker0611
Copy link
Author

baker0611 commented Dec 13, 2017

on mac os 10.13.2 (17C88)

@baker0611
Copy link
Author

there's no problem on Windows

@MattIrv
Copy link
Contributor

MattIrv commented Dec 13, 2017

As you mention, it may be some sort of encoding problem. If you open the terminal on Mac and run the command echo $LANG, what is the output?

@baker0611
Copy link
Author

zh_CN.UTF-8

@MattIrv
Copy link
Contributor

MattIrv commented Dec 15, 2017

I have seen that we have problems with some locales, but that one should work correctly.

You could try launching VS Code from the command line (by running code) and maybe that will work around the problem.

Otherwise I will keep trying to reproduce the issue, but without additional reports it may be difficult since I've had no luck so far.

Thanks for continuing to help track this down.

@mkurz
Copy link

mkurz commented Dec 21, 2017

Same happened to me using Ubuntu. Installing xclip solved the problem.

@baker0611
Copy link
Author

may i ask a question? what tools to link sql-server?

@czarkoff
Copy link

I am having a seemingly related problem on macOS High Sierra: when I copy text from results pane I get something that looks like a UTF-8 bytestream run through utf-8 encoder as 8-bit input, so that eg. "ć" is consistently replaced with "ƒá". CSV output is fine even though.

$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

@MattIrv
Copy link
Contributor

MattIrv commented Jan 3, 2018

may i ask a question? what tools to link sql-server?

@baker0611 I'm not sure what you mean by that. Can you clarify?

@czarkoff Thanks for the information. If you need a workaround, you could try opening a terminal window, running the command export LANG=en_US.UTF-8 (or another UTF-8 locale, you can run locale -a to list all valid locales) and then starting VS Code from the same terminal window by running code.

@diegotrujillor
Copy link

Same problem here with Debian 9. The workaround works for me, thanks.

@doow118
Copy link

doow118 commented Apr 11, 2018

Version 1.3.1 has resolved Chinese text copy & paste issue.
Very thanks.

@MattIrv
Copy link
Contributor

MattIrv commented Apr 11, 2018

Glad to hear the fix is working as expected. I'll close this issue now and track the Linux changes in a separate one

@MattIrv MattIrv closed this as completed Apr 11, 2018
@ibrowne
Copy link

ibrowne commented Oct 22, 2019

@MattIrv SO glad this is fixed! It was bugging the heck out of me! Great job tracking it down and releasing the fix. Keep up the good work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants