<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 30, 2016, at 1:18 PM, Andre LaBranche <<a href="mailto:dre@apple.com" class="">dre@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">This is not expected. Does memcached need to be configured for Unicode, maybe?</span></div></blockquote></div><br class=""><div class="">It looks like we expect to be in ascii mode, as far as memcached is concerned:</div><div class=""><br class=""></div><div class="">You can debug the memcache side of this by configuring calendarserver to not launch memcached; instead you'll do so manually, in the foreground.</div><div class=""><br class=""></div><div class="">Edit caldavd.plist, and insert the following Pools configuration under the Memcached dict:</div><div class=""><br class=""></div><div class=""> <key>Pools</key><br class=""> <dict><br class=""> <key>Default</key><br class=""> <dict><br class=""> <key>MemcacheSocket</key><br class=""> <string></string><br class=""> <key>ServerEnabled</key><br class=""> <false/><br class=""> <key>BindAddress</key><br class=""> <string>127.0.0.1</string><br class=""> <key>Port</key><br class=""> <integer>11211</integer><br class=""> </dict><br class=""> </dict></div><div class=""><br class=""></div><div class="">Manually start memcached in verbose mode on 127.0.0.1:</div><div class="">memcached -l 127.0.0.1 -vv</div><div class=""><br class=""></div><div class="">Start calendar server, load a principal page: <a href="https://whatever:8443/principals/users/you" class="">https://whatever:8443/principals/users/you</a></div><div class=""><br class=""></div><div class="">As you log in, you should see stuff in the memcached window:</div><div class=""><br class=""></div><div class=""><22 new auto-negotiating client connection<br class="">22: Client using the <b class="">ascii protocol</b><br class=""><22 get DIGESTCREDENTIALS:...</div><div class="">>22 END<br class=""><br class=""></div><div class=""><br class=""></div><div class="">Also try the following test script which sets and gets unicode strings. bytes. whatever they are :) In SVN mode, I run ./bin/python mctest.py from the SVN dir to make sure the interpreter has access to six and memcache. If you don't use SVN mode, and don't have these modules installed system-wide, edit PYTHONPATH to help your interpreter find these modules.</div><div class=""><br class=""></div><div class="">#!/usr/bin/python<br class=""># -*- coding: latin-1 -*-<br class="">from __future__ import print_function<br class=""><br class="">import six<br class="">from memcache import Client, SERVER_MAX_KEY_LENGTH, SERVER_MAX_VALUE_LENGTH<br class=""><br class="">servers = ["127.0.0.1:11211"]<br class="">mc = Client(servers, debug=1)<br class=""><br class="">def setget(key, val):<br class=""> mc.set(key, val)<br class=""> newval = mc.get(key)<br class=""> print("key:", key)<br class=""> print("set:".rjust(8), val)<br class=""> print ("got:".rjust(8), newval, "\n")<br class=""><br class="">setget("ascii", "xyzzy")<br class=""><br class="">setget("unicode_1", six.u('\U0001f648'))<br class="">setget("unicode_2", six.u('\u25c9'))<br class="">setget("unicode_3", six.u('\u4f1a'))<br class="">setget("unicode_4", six.u('dr\\xe9'))<br class=""><br class="">mc.disconnect_all()<br class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Output looks like:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">key: ascii</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> set: xyzzy</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> got: xyzzy </div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">key: unicode_1</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> set: 🙈</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> got: 🙈 </div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">key: unicode_2</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> set: ◉</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> got: ◉ </div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">key: unicode_3</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> set: 会</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> got: 会 </div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">key: unicode_4</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> set: dré</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> got: dré </div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">... and the memcached log confirms we're still in ascii mode:</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""><25 new auto-negotiating client connection<br class="">25: Client using the ascii protocol<br class=""><25 set ascii 0 0 5 <br class="">>25 STORED<br class=""><25 get ascii<br class="">>25 sending key ascii<br class="">>25 END<br class=""><25 set unicode_1 0 0 4 <br class="">>25 STORED<br class=""><25 get unicode_1<br class="">>25 sending key unicode_1<br class="">>25 END<br class=""></span></font><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">-dre</div></body></html>