I do know that the US treaty with Japan near the end of the Edo period included provisions for taking care of shipwrecked sailors:
"Whenever ships of the United States are thrown or wrecked on the coast of Japan, the Japanese vessels will assist them, and carry their crews to Simoda or Hakodadi and hand them over to their countrymen appointed to receive them. Whatever articles the shipwrecked men may have preserved shall likewise be restored and the expenses incurred in the rescue and support of Americans and Japanese who may thus be thrown up on the shores of either nation are not to be refunded."
http://avalon.law.yale.edu/19th_century/japan002.asp
But I am not sure if this was included as a part of a normal treaty or was addressing past issues of treatment of sailors.