c# - ToUpper and ToLower returning CJK characters -


a friend has c# code on machine returning cjk characters when toupper , tolower called on strings. toupperinvariant appears work.

here of results:

//precondition: var viewname = "advancedview";  viewname.toupper()[0]; //23429 '宅' viewname.toupper()[1]; //13723 '㖛'  "astring".toupper(); //"؜㪑瓁ᩤ哚ὸ悕"  "hello".toupper(system.globalization.cultureinfo.createspecificculture("en-us")) //"粩ᕿዳዳ㐧"  "hello".tolower() //"ሼ㉱㰖㰖晐" "hello".toupper().tolower() //"蠼䫡贫贫肅"  viewname[0]; //65 'a' viewname[1]; //100 'd' viewname[2]; //118 'v'  viewname.toupperinvariant() //advancedview 

cultureinfo.currentculture, cultureinfo.currentuiculture, , system.threading.thread.currentthread.currentculture return same culture (en-us):

system.threading.thread.currentthread.currentculture {en-us}     calendar: {system.globalization.gregoriancalendar}     calendar: {system.globalization.gregoriancalendar}     compareinfo: {compareinfo - en-us}     compareinfo: {compareinfo - en-us}     createddomainid: 0     cultureid: 127     culturetypes: specificcultures | installedwin32cultures | frameworkcultures     datetimeformat: {system.globalization.datetimeformatinfo}     datetimeinfo: {system.globalization.datetimeformatinfo}     displayname: "english (united states)"     englishname: "english (united states)"     hasinvariantculturename: false     ietflanguagetag: "en-us"     isneutralculture: false     isreadonly: true     issafecrossdomain: false     keyboardlayoutid: 1033     lcid: 1033     m_consolefallbackculture: null     m_createddomainid: 0     m_culturedata: {system.globalization.culturedata}     m_dataitem: 0     m_isinherited: false     m_isreadonly: true     m_issafecrossdomain: false     m_name: "en-us"     m_nonsortname: "en-us"     m_parent: {en}     m_sortname: "en-us"     m_useuseroverride: false     name: "en-us"     nativename: "english (united states)"     numberformat: {system.globalization.numberformatinfo}     numinfo: {system.globalization.numberformatinfo}     optionalcalendars: {system.globalization.calendar[2]}     parent: {en}     region: {us}     regioninfo: {us}     sortname: "en-us"     textinfo: {textinfo - en-us}     textinfo: {textinfo - en-us}     threeletterisolanguagename: "eng"     threeletterwindowslanguagename: "enu"     twoletterisolanguagename: "en"     useuseroverride: true  

the culture info has useuseroverride set true, passing in culture set false provides same results:

var info = new cultureinfo("en-us", false); str.toupper(info); //"㪑瓁ᩤ 

cultureinfo.currentculture.textinfo looks benign (ansicodepage 1252 , oemcodepage 437).

what's going on here? there perhaps wrong hardware?


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -