function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ayan HoreAyan Hore 

Compare Japanese or Chinese strings in Salesforce. Remove the separators.

Hi,

I'm trying to compare two Japanese or Chinese string to see if they are same using Apex. By that, I mean there might be some separators or special characters (Example: New. Life and New Life in Simplified Chinese are 新。生活 (Xīn. Shēnghuó) and 新生活 (Xīn shēnghuó) respectively, notice the (。) character in the first one. In essence both these strings are same, however, if I simply compare them using String equals, they are different). For English, this is simple - use a pattern matcher to retain only alphanumeric values.

One way would be to identify the special characters (like: 。) and remove them and then compare. If there is any such list (Japanese and Chinese - Traditional/Simplified), I would be grateful if anyone can provide.

I'm just looking for any ideas/advice/code-samples of similiar situations faced by anyone in this forum.

Any help would be greatly appreciated.

Disclaimer: I admit, I only looked at this problem very shortly, so I will continue my research and will post any updates (if any).

Cheers,
Ayan