Case-insensitive storage and unicode compatibility

前端 未结 3 663
清酒与你
清酒与你 2020-12-08 22:46

After I heard of someone at my work using String.toLowerCase() to store case-insensitive codes in a database for searchability, I had an epic fail moment thinki

3条回答
  •  感动是毒
    2020-12-08 23:33

    I think the most long term solution is to

    • record the current default locale and technology stack version (in my case Java version) into configuration
    • if it's changed (since last start up, or running for locale - depending on how it's loaded by said technology stack), then lock the store and re-index all affected data sets.

    Obviously, this needs to occur at the primary interface level; if I'm doing these changes in java, I better hope that it's my only data interface mechanism (e.g. that other techs are not querying the underlying table store)

提交回复
热议问题