Cambio de codificación en ASP
Cuando programamos una aplicación ASP para un servidor que no es nuestro o incluso para evitar problemas de en que servidor se instale la aplicación, un aspecto a tener en cuenta es el idioma que tiene por defecto el servidor.
Según el idioma del servidor, la forma de formatear las fechas y los números son distintas dependiendo del país.
Las fechas:
formato español: dd/mm/aaaa
formato americano: mm/dd/aaaa
dd: día
mm: mes
aaaa: año
Los números:
formato español: 11,5
formato americano: 11.5
Si no tenemos acceso a la configuración del servidor, o simplemente no queremos sorpresas al cambiar de un servidor a otro, lo solucionaremos al añadir la siguiente linea a nuestros ASPs.
session.LCID = 1034
Por ejemplo el código 1034 es para español de España.
Aquí la lista con las diferentes codificaciones que podemos poner.
Locale | Language | LCID string | LCID | Locale | Language | LCID string | LCID | |
---|---|---|---|---|---|---|---|---|
Afrikaans | af | af | 1078 | Igbo – Nigeria | 1136 | |||
Albanian | sq | sq | 1052 | Indonesian | id | id | 1057 | |
Amharic | am | am | 1118 | Italian – Italy | it | it-it | 1040 | |
Arabic – Algeria | ar | ar-dz | 5121 | Italian – Switzerland | it | it-ch | 2064 | |
Arabic – Bahrain | ar | ar-bh | 15361 | Japanese | ja | ja | 1041 | |
Arabic – Egypt | ar | ar-eg | 3073 | Kannada | kn | kn | 1099 | |
Arabic – Iraq | ar | ar-iq | 2049 | Kashmiri | ks | ks | 1120 | |
Arabic – Jordan | ar | ar-jo | 11265 | Kazakh | kk | kk | 1087 | |
Arabic – Kuwait | ar | ar-kw | 13313 | Khmer | km | km | 1107 | |
Arabic – Lebanon | ar | ar-lb | 12289 | Konkani | 1111 | |||
Arabic – Libya | ar | ar-ly | 4097 | Korean | ko | ko | 1042 | |
Arabic – Morocco | ar | ar-ma | 6145 | Kyrgyz – Cyrillic | 1088 | |||
Arabic – Oman | ar | ar-om | 8193 | Lao | lo | lo | 1108 | |
Arabic – Qatar | ar | ar-qa | 16385 | Latin | la | la | 1142 | |
Arabic – Saudi Arabia | ar | ar-sa | 1025 | Latvian | lv | lv | 1062 | |
Arabic – Syria | ar | ar-sy | 10241 | Lithuanian | lt | lt | 1063 | |
Arabic – Tunisia | ar | ar-tn | 7169 | Malay – Brunei | ms | ms-bn | 2110 | |
Arabic – United Arab Emirates | ar | ar-ae | 14337 | Malay – Malaysia | ms | ms-my | 1086 | |
Arabic – Yemen | ar | ar-ye | 9217 | Malayalam | ml | ml | 1100 | |
Armenian | hy | hy | 1067 | Maltese | mt | mt | 1082 | |
Assamese | as | as | 1101 | Manipuri | 1112 | |||
Azeri – Cyrillic | az | az-az | 2092 | Maori | mi | mi | 1153 | |
Azeri – Latin | az | az-az | 1068 | Marathi | mr | mr | 1102 | |
Basque | eu | eu | 1069 | Mongolian | mn | mn | 1104 | |
Belarusian | be | be | 1059 | Mongolian | mn | mn | 2128 | |
Bengali – Bangladesh | bn | bn | 2117 | Nepali | ne | ne | 1121 | |
Bengali – India | bn | bn | 1093 | Norwegian – Bokml | nb | no-no | 1044 | |
Bosnian | bs | bs | 5146 | Norwegian – Nynorsk | nn | no-no | 2068 | |
Bulgarian | bg | bg | 1026 | Oriya | or | or | 1096 | |
Burmese | my | my | 1109 | Polish | pl | pl | 1045 | |
Catalan | ca | ca | 1027 | Portuguese – Brazil | pt | pt-br | 1046 | |
Chinese – China | zh | zh-cn | 2052 | Portuguese – Portugal | pt | pt-pt | 2070 | |
Chinese – Hong Kong SAR | zh | zh-hk | 3076 | Punjabi | pa | pa | 1094 | |
Chinese – Macau SAR | zh | zh-mo | 5124 | Raeto-Romance | rm | rm | 1047 | |
Chinese – Singapore | zh | zh-sg | 4100 | Romanian – Moldova | ro | ro-mo | 2072 | |
Chinese – Taiwan | zh | zh-tw | 1028 | Romanian – Romania | ro | ro | 1048 | |
Croatian | hr | hr | 1050 | Russian | ru | ru | 1049 | |
Czech | cs | cs | 1029 | Russian – Moldova | ru | ru-mo | 2073 | |
Danish | da | da | 1030 | Sami Lappish | 1083 | |||
Divehi; Dhivehi; Maldivian | dv | dv | 1125 | Sanskrit | sa | sa | 1103 | |
Dutch – Belgium | nl | nl-be | 2067 | Serbian – Cyrillic | sr | sr-sp | 3098 | |
Dutch – Netherlands | nl | nl-nl | 1043 | Serbian – Latin | sr | sr-sp | 2074 | |
Edo | 1126 | Sesotho (Sutu) | 1072 | |||||
English – Australia | en | en-au | 3081 | Setsuana | tn | tn | 1074 | |
English – Belize | en | en-bz | 10249 | Sindhi | sd | sd | 1113 | |
English – Canada | en | en-ca | 4105 | Sinhala; Sinhalese | si | si | 1115 | |
English – Caribbean | en | en-cb | 9225 | Slovak | sk | sk | 1051 | |
English – Great Britain | en | en-gb | 2057 | Slovenian | sl | sl | 1060 | |
English – India | en | en-in | 16393 | Somali | so | so | 1143 | |
English – Ireland | en | en-ie | 6153 | Sorbian | sb | sb | 1070 | |
English – Jamaica | en | en-jm | 8201 | Spanish – Argentina | es | es-ar | 11274 | |
English – New Zealand | en | en-nz | 5129 | Spanish – Bolivia | es | es-bo | 16394 | |
English – Phillippines | en | en-ph | 13321 | Spanish – Chile | es | es-cl | 13322 | |
English – Southern Africa | en | en-za | 7177 | Spanish – Colombia | es | es-co | 9226 | |
English – Trinidad | en | en-tt | 11273 | Spanish – Costa Rica | es | es-cr | 5130 | |
English – United States | en | en-us | 1033 | Spanish – Dominican Republic | es | es-do | 7178 | |
English – Zimbabwe | en | 12297 | Spanish – Ecuador | es | es-ec | 12298 | ||
Estonian | et | et | 1061 | Spanish – El Salvador | es | es-sv | 17418 | |
Faroese | fo | fo | 1080 | Spanish – Guatemala | es | es-gt | 4106 | |
Farsi – Persian | fa | fa | 1065 | Spanish – Honduras | es | es-hn | 18442 | |
Filipino | 1124 | Spanish – Mexico | es | es-mx | 2058 | |||
Finnish | fi | fi | 1035 | Spanish – Nicaragua | es | es-ni | 19466 | |
French – Belgium | fr | fr-be | 2060 | Spanish – Panama | es | es-pa | 6154 | |
French – Cameroon | fr | 11276 | Spanish – Paraguay | es | es-py | 15370 | ||
French – Canada | fr | fr-ca | 3084 | Spanish – Peru | es | es-pe | 10250 | |
French – Congo | fr | 9228 | Spanish – Puerto Rico | es | es-pr | 20490 | ||
French – Cote d’Ivoire | fr | 12300 | Spanish – Spain (Traditional) | es | es-es | 1034 | ||
French – France | fr | fr-fr | 1036 | Spanish – Uruguay | es | es-uy | 14346 | |
French – Luxembourg | fr | fr-lu | 5132 | Spanish – Venezuela | es | es-ve | 8202 | |
French – Mali | fr | 13324 | Swahili | sw | sw | 1089 | ||
French – Monaco | fr | 6156 | Swedish – Finland | sv | sv-fi | 2077 | ||
French – Morocco | fr | 14348 | Swedish – Sweden | sv | sv-se | 1053 | ||
French – Senegal | fr | 10252 | Syriac | 1114 | ||||
French – Switzerland | fr | fr-ch | 4108 | Tajik | tg | tg | 1064 | |
French – West Indies | fr | 7180 | Tamil | ta | ta | 1097 | ||
Frisian – Netherlands | 1122 | Tatar | tt | tt | 1092 | |||
FYRO Macedonia | mk | mk | 1071 | Telugu | te | te | 1098 | |
Gaelic – Ireland | gd | gd-ie | 2108 | Thai | th | th | 1054 | |
Gaelic – Scotland | gd | gd | 1084 | Tibetan | bo | bo | 1105 | |
Galician | gl | 1110 | Tsonga | ts | ts | 1073 | ||
Georgian | ka | 1079 | Turkish | tr | tr | 1055 | ||
German – Austria | de | de-at | 3079 | Turkmen | tk | tk | 1090 | |
German – Germany | de | de-de | 1031 | Ukrainian | uk | uk | 1058 | |
German – Liechtenstein | de | de-li | 5127 | Unicode | UTF-8 | 0 | ||
German – Luxembourg | de | de-lu | 4103 | Urdu | ur | ur | 1056 | |
German – Switzerland | de | de-ch | 2055 | Uzbek – Cyrillic | uz | uz-uz | 2115 | |
Greek | el | el | 1032 | Uzbek – Latin | uz | uz-uz | 1091 | |
Guarani – Paraguay | gn | gn | 1140 | Venda | 1075 | |||
Gujarati | gu | gu | 1095 | Vietnamese | vi | vi | 1066 | |
Hebrew | he | he | 1037 | Welsh | cy | cy | 1106 | |
HID (Human Interface Device) | 1279 | Xhosa | xh | xh | 1076 | |||
Hindi | hi | hi | 1081 | Yiddish | yi | yi | 1085 | |
Hungarian | hu | hu | 1038 | Zulu | zu | zu | 1077 | |
Icelandic | is | is | 1039 |