When using some double-byte text strings in Custom Settings Name field that are much shorter than 38 characters, "Error: Custom Setting Name too long" error still happens.
Custom Settings is a Salesforce feature that allows administrators to create custom data sets and associate them with an organization, profile, or user. Double-byte characters are characters used in languages such as Chinese, Japanese, and Korean, where each character requires two bytes of storage rather than the single byte used by standard ASCII characters. This error typically appears when an admin or developer creates a Custom Setting and enters a name using double-byte characters that visually appears well under the 38-character limit. The unexpected behavior occurs because Salesforce internally converts the double-byte string into ASCII format using the Java toASCII() method before applying the limit — and that conversion can cause the string length to increase non-linearly, meaning a short-looking input can exceed 38 characters after conversion.
When double-byte characters such as Chinese or Japanese are used in the Custom Settings Name field, Salesforce converts the string to ASCII using the Java toASCII() method before applying the 38-character limit. Because this conversion can increase string length non-linearly, even short double-byte strings may exceed the limit.
If double-byte texts are used in Custom Settings field, consider making the text strings shorter.
As per Define Custom Settings
"The name can't exceed 38 ASCII characters. If you use double byte, there are additional limits on the number of characters allowed."
When double-byte characters are used, the string is converted into ASCII characters by using JAVA method toASCII() . The 38-character limit is then applied to the converted ASCII string.
As the converted string's length can increase nonlinearily, a relatively short input string could potentially be converted to strings longer than 38-characters.
It is recommended to check a given string's converted length by using JAVA For example:
//Within limit
System.out.println(java.net.IDN.toASCII("一二三四五六七八九十壹贰三").length());
//Exceeding limit
System.out.println(java.net.IDN.toASCII("一二三四五六七八九十壹贰三四").length());
Certain online JAVA Complier tools such as tutorialspoint.com can be conveniently utilized.
The character limit for the Name field when creating data for a Custom Setting seems lower when using certain characters.
000397067

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.