Unicode Replacement Character (U+FFFD) - Sublime Forum

文章推薦指數: 80 %
投票人數:10人

I am currently working on a c++ project where it sometimes happens that typing a space is interpreted as the unicode character . UnicodeReplacementCharacter�(U+FFFD) TechnicalSupport Nicii April20,2020,2:05pm #1 Iamcurrentlyworkingonac++projectwhereitsometimeshappensthattypingaspaceisinterpretedastheunicodecharacter�.Thisresultsinthecompilationcrashingwhichisratherannoying.IthenreturntothecodeImanuallychangealloccurrencesthereofanditisinterpretedaswanted.Atalaterpoint,whenIagainchangesomecodeitrandomly(Isayrandomly,becauseIhavenotyetfoundwhyandwhenithappens)interpretsitasaspaceor�.IamusingUbuntu18.04.4LTSandSublimeTextVersion3.2.2.DoyouhaveanyideawhyithappensandwhatIhavetochangesuchitdoesnot? 0Likes deathaxe April20,2020,3:02pm #2 PackageslikeUnicodeCompletionssometimestendtotriggerifspaceispressed,butthisnormallycausesvisiblecharacterstobeconvertedtounicodecodepoints. Thebestchancetofindtheissue,wastoenablecommandloggingbysublime.log_commands(True)andchecktheconsoleoutputoncesuchanunicodespacewasadded.Withsomeluck,youcanfindtheplugin/commandcausingthat,then. 0Likes Nicii April20,2020,8:03pm #3 Iwasabletopinpointthecommandsleadinguptomysituation.Iwaswritingthefollowinglineofcodebyhandanditinsertsthecharactersaftertheequalsign. Shadow=��combineShadows(Shadow,ScopeLabel,Pos); Iactuallybeganwith combineShadows(Shadow,ScopeLabel,Pos); andprependeditwith Shadow=�� Thecommandsarethefollowing: command:drag_select{“event”:{“button”:1,“x”:522.024902344,“y”:235.879241943}} command:toggle_comment{“block”:true} command:drag_select{“event”:{“button”:1,“x”:409.985229492,“y”:226.698822021}} command:insert{“characters”:“\n”} command:insert_snippet{“contents”:“($0)”} command:insert_best_completion{“default”:“\t”,“exact”:false} command:left_delete command:move{“by”:“characters”,“forward”:true} command:move{“by”:“words”,“forward”:false} command:move{“by”:“words”,“forward”:false} command:move{“by”:“words”,“forward”:false} command:move{“by”:“words”,“forward”:false} command:move{“by”:“words”,“forward”:false} command:left_delete command:save command:drag_select{“event”:{“button”:1,“x”:592.408691406,“y”:367.914794922}} command:drag_select{“event”:{“button”:1,“x”:625.93762207,“y”:408.361328125}} 0Likes Nicii April22,2020,11:01am #4 Ok,Ifoundthereason.Usingspacewhilepressingshiftcreatesthatunicodecharacter.SinceIoftenwriteuppercaselettersafteraspaceIseemtopressitprematurelywhichcausesittoappear.Iwillgooglehowtodisablethatbutifyoualreadyknowit,Iwouldappreciateitifyoucouldpointitoutforme:). Edit:Here,someuserhadasimilarproblem.Mightberelatedtomine.https://apple.stackexchange.com/questions/219686/disable-spaceshift-in-sublime-text Edit*:Ieventuallyfoundtherootoftheproblem.Onmysystem,shift+spaceismappedtoaninputcalled“nobreakspace”.Thisistranslatedinsublimeintothatunicodecharacter.So,Isolveditbymappingthatkeycombinationtospace(usingxevandxmodmaponUbuntu). 1Like



請為這篇文章評分?