Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/11/2009 at 11:50, xxxxxxxx wrote:
User Information: Cinema 4D Version: 10.1 Platform: Windows ; Mac OSX ; Language(s) : C++ ;
--------- Hi,
just a small question... why does the following code work on PC, but not on Mac?
String ReplaceStr(String Original, String Search, String Replacement) // Replace a Substring in a String { String res = Original; LONG i = 0; while (res.FindFirst(Search, &i;, i)) { res.Delete(i, Search.GetLength()); res.Insert(i, Replacement); } return res; } String ConvertHTMLchars(String tmpl) // Substitute special characters by their HTML entities { String res = tmpl; res = ReplaceStr(res, "ä", "& auml;"); res = ReplaceStr(res, "ö", "& ouml;"); res = ReplaceStr(res, "ü", "& uuml;"); res = ReplaceStr(res, "Ä", "& Auml;"); res = ReplaceStr(res, "Ö", "& Ouml;"); res = ReplaceStr(res, "Ü", "& Uuml;"); res = ReplaceStr(res, "ß", "& szlig;"); res = ReplaceStr(res, "€", "& euro;"); res = ReplaceStr(res, "é", "& eacute;"); res = ReplaceStr(res, "É", "& Eacute;"); res = ReplaceStr(res, "Ê", "& Ecirc;"); res = ReplaceStr(res, "ê", "& ecirc;"); res = ReplaceStr(res, "È", "& Egrave;"); res = ReplaceStr(res, "è", "& egrave;"); res = ReplaceStr(res, "Â", "& Acirc;"); res = ReplaceStr(res, "â", "& acirc;"); res = ReplaceStr(res, "À", "& Agrave;"); res = ReplaceStr(res, "à", "& agrave;"); res = ReplaceStr(res, "Å", "& Aring;"); res = ReplaceStr(res, "å", "& aring;"); return res; }
On PC, the special characters are replaced by HTML entities. On Mac, nothing happens. Why?
Cheers, Jack
On 25/11/2009 at 12:22, xxxxxxxx wrote:
I editied the code, it didn't display correctly before.
On 25/11/2009 at 12:55, xxxxxxxx wrote:
Have you tried Unicode formatting instead ("\u0..." - "\u00a9" for the copyright symbol as you might encode it in your c4d_strings.str file)? The fact that they display in your IDE just means that the font being used has Unicode characters in it.
On 25/11/2009 at 14:18, xxxxxxxx wrote:
Ha, that sounds perfectly reasonable. After encoding all the special chars to Unicode, it still works on PC... will see in a couple of minutes if it does so on the Mac, too
On 25/11/2009 at 14:35, xxxxxxxx wrote:
Hm, unfortunately it still does not work in Mac But thanks any way for the input!
On 25/11/2009 at 14:42, xxxxxxxx wrote:
Hi Jack, I suggest you to convert the String with 'StringEncoding' to 'StHTML'. This should work fine. Good luck
P.S: 'StHTML' might be not documentated(in R10), even available in the sources.
On 25/11/2009 at 14:52, xxxxxxxx wrote:
Arrgh, I have always thought that was introduced with R11. They could really have put that into the R10 SDK docs...
Thanks a lot!
Greetings, Jack