en_US or en-US, which one should you use?(en_US 或 en-US,您应该使用哪一个?)
问题描述
假设您要将用户偏好的语言环境存储在数据库中,您将使用哪个值?
Assume you want to store the locale of user preference in database, which value you will use?
en_US 或 en-US
en_US or en-US
它们是两个标准,但您更喜欢将哪一个用作您自己的应用程序的一部分?
They are two standards, but which one you prefer to use as part of your own application?
更新:似乎很多网站都使用破折号而不是下划线,例如
Updated: Is seems many web sites use dash instead of underscore, e.g.
http://zh.wikipedia.org/zh-twhttp://www.google.com.hk/search?hl=zh-TW
推荐答案
我很确定-"是标准.如果您看到_"在某个地方,它可能是某些人想出的让它成为有效标识符的东西.
I'm pretty sure "-" is the standard. If you see "_" somewhere it's probably something some people came up with to make it a valid identifier.
为了正确起见,我个人会选择-".
Personally I'd go with "-", just to be correct.
http://en.wikipedia.org/wiki/IETF_language_tag
https://datatracker.ietf.org/doc/html/rfc5646
这篇关于en_US 或 en-US,您应该使用哪一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:en_US 或 en-US,您应该使用哪一个?
基础教程推荐
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 存储 20 位数字的数据类型 2022-01-01
