-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Open
Labels
EnhancementIO DataIO issues that don't fit into a more specific labelIO issues that don't fit into a more specific labelNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action
Description
Feature Type
-
Adding new functionality to pandas
-
Changing existing functionality in pandas
-
Removing existing functionality in pandas
Problem Description
Code following will raise NotImplementedError: reading from clipboard only supports utf-8 encoding
df = pd.read_clipboard(encoding="gbk")BUT, if user do it with:
pd.io.clipboard.ENCODING = "gbk"
df = pd.read_clipboard()
pd.io.clipboard.ENCODING = "utf8"It works well.
Feature Description
I am not sure why encoding in pandas is fixed to 'utf8', but in wsl2 user's windows system default encoding is usually not Unicode and very hard to migrate this settings.
Allow user change encoding of read_clipboard will be very helpful.
Alternative Solutions
pd.io.clipboard.ENCODING = "gbk"
df = pd.read_clipboard()
pd.io.clipboard.ENCODING = "utf8"Additional Context
data for testting:
| 这 | 1 |
|---|---|
| 是 | 2 |
| 一 | 3 |
| 个 | 4 |
| 表 | 5 |
# stdout[:-2]
data = b'\xd5\xe2\t1\r\n\xca\xc7\t2\r\n\xd2\xbb\t3\r\n\xb8\xf6\t4\r\n\xb1\xed\t5\r\n'
Metadata
Metadata
Assignees
Labels
EnhancementIO DataIO issues that don't fit into a more specific labelIO issues that don't fit into a more specific labelNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action