Whenever upon the settlement of an estate or upon the sale of lands for division in any court of this state it is shown that any of the heirs, distributees, or other persons entitled to share in the funds derived therefrom, whether adults or minors, are residents and subjects of a foreign country and are not represented by counsel of their own employment, the personal representative, judge of probate, clerk, or register who may have the custody of said funds shall pay over the shares of such persons to the duly accredited consular officer of such country within whose jurisdiction the said court is situated and obtain from him full acquittance therefor.