Unicode Replacement Character (U+FFFD) - Sublime Forum
文章推薦指數: 80 %
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
延伸文章資訊
- 1replacement character (U+FFFD) - Graphemica
U+FFFC • U+10000 𐀀. · · ·. Info · Code · Related · Glyphs · Chart · Encodings · Data · Tags · Com...
- 2Unicode字符列表- 维基百科,自由的百科全书
本條目以列表形式展示並介紹Unicode字符。如果字母顯示模糊,請將瀏覽器字型調為例如「Arial ... U+FFFD, , 佔位字元(英語:Replacement Character).
- 3Unicode字元列表- 維基百科,自由的百科全書
- 4ConPTY mangles U+1F600 to U+FFFD · Issue #2770 - GitHub
U+FFFD, REPLACEMENT CHARACTER, gets sent through instead. This doesn't affect most characters. Th...
- 5document and implement invalid UTF-8 treated as U+FFFD ...
Invalid UTF-8 gets turned, one byte at a time, into U+FFFD. Here is text from the spec about rang...