for Java6, emulate subset of IETF BCP 47, fixed #474

for Java6, emulate subset of IETF BCP 47, fixed #474