forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
486 stars 78 forks source link

Accent marks not encoded on retrieve #631

Closed jesuRule closed 3 years ago

jesuRule commented 3 years ago

Summary

When retrieving metadata with accent marks (for example, a Profile named "Atención"), these characters are not encoded in the local file system. Is this the expected?

Other special characters are do encoded such as forward slashes, backslashes, quotation marks or commas.

Steps To Reproduce:

  1. Create a Profile with a name containing an accent mark. For example "Atención".
  2. Retrieve the Profile metadata: sfdx force:mdapi:retrieve -u TARGETUSERNAME -r RETRIEVETARGETDIR -k UNPACKAGED -w -1

Expected result

Profile downloaded in local file system with encoded name? -> "Atenci%C3%B3n.profile"

Actual result

Profile name is not encoded. Profile name: "Atención.profile".

Additional information

A manual encoding is needed before deploying back the Profile, otherwise an error is faced: UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 511692291-249672 (-375156510).

SFDX CLI Version: sfdx-cli/7.74.1-32db2396ed win32-x64 node-v12.18.3

SFDX plugin Version


@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.0 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/lwc-dev-server 2.5.1
├─ @oclif/plugin-help 2.2.3
└─ @oclif/plugin-update 1.3.9
@salesforce/sfdx-diff 0.0.6
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.1 (core)
analytics 1.12.1 (core)
config 1.1.8 (core)
generator 1.1.3 (core)
salesforcedx 49.10.0 (core)
├─ salesforce-alm 49.11.0 (core)
├─ templates 49.4.4 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
├─ custom-metadata 1.0.10 (core)
└─ apex 0.0.9 (core)
sfdmu 3.7.0
sfdx-cli 7.74.1 (core)
sfdx-ext 0.0.43```

**OS and version**:
Windows 10 Pro
uip-robot-zz commented 3 years ago

This issue has been linked to a new work item: W-9300215

mshanemc commented 3 years ago

@jesuRule we're trying to figure out what the correct format should be. What tool are you using that's producing encoded filenames that don't match the CLI?

jesuRule commented 3 years ago

I am using this encoder: https://coderstoolbox.net/string/#!encoding=url&action=encode&charset=utf_8

mshanemc commented 3 years ago

We're going to leave the accents marks.

They deploy and retrieve properly as is. If we were to change them to encode, it would be disruptive to people's source-based projects.