LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Turkish special characters displayed incorrectly

Solved!
Go to solution

I had same issue long time ago. The following line had solved my issue at that time.

 

UseUnicode=True

 

Now I have an interesting issue as in the picture.

 

Turkish special charactersTurkish special characters

 

For a while I have been developing applications in English language. So I am not sure if this is totally a new issue or it was there for a while but I did not notice. I think this is totally a new because I am sure somehow I have noticed this. And when I check another computer everything seems fine.

 

No issueNo issue

 

I can write special characters but when I run the code they are displayed incorrectly.

 

Labview 2021

Labview 2022 Q3

Windows 11

 

0 Kudos
Message 1 of 8
(3,653 Views)

What is your local language setting in Windows in these cases? LabVIEW Unicode support is not even experimental but at best alpha state. It means it has been added with minimal testing but never formalized and fully tested. It was considered a too hard problem to tackle at that time and abandoned but never removed from the code base.

 

If your local language setting is set to Turkish, LabVIEW will actually support Turkish characters even without using Unicode since it uses the local region settings by default. Now if your constant where you enter the Turkish characters is not set to be Unicode explicitly too, the string entered will simply be the ANSI string using the current Windows codepage, hence the codepage 1254 characters. If you then change the local language settings the bytes in this constant will stay the same but display different characters. You then wire this byte stream to a control which is told to interpret the bytes as Unicode characters. And bam it goes wrong, since the codepage 1254 byte codes are simply interpreted as a Unicode byte stream and that will surely result in something completely different, usually chances are pretty high that you will see at least some Chinese characters then.

 

You must make sure that all strings that you want to display Unicode are also set to be Unicode. You can not wire different types of string encodings together as the LabVIEW Unicode support never has been finalized to deal with such encoding mismatches and automagically do the right thing. The attribute, if the string is considered Unicode or not is simply part of the actual control or constant, but not part of the actual byte stream data that is flowing through your wire, so if the source and sink of such a wire do not match in what the bytes should mean it simply goes wrong.

 

It's similar to how the hex, decimal and octal display options work. The indicator displaying an integer value has no idea if the source from where this integer comes used hex, octal or decimal display mode and doesn't care about that. It sees an integer and formats the display according to its own local setting and that's it. A string is simply a sequence of bytes and by default is interpreted according to the ANSI codepage set in Windows as local language. If you enable the Unicode attribute the control or indicator simply interpretes the bytes as Unicode and that's it. But unlike with the display format of integers, string display encoding is a lot more complicated and there are many corner cases and complications that are very difficult to handle properly and the people who have worked on that in LabVIEW apparently threw their hands in the air at some point and probably quit their job.

 

The main problem is that LabVIEW started out with treating strings as simply a bit of syntactic sugar around a byte stream. Other languages actually did the same such as Python where strings were initially also just byte streams instead of its own distinctive first class datatype citizen. Python at some point did a pretty radical cut and decided to make strings simply always Unicode, and that was a painful transition for many Python programmers. The LabVIEW developers tried to avoid that and since the main LabVIEW use was in instrument control and measurement applications they could get away for a long time by simply deferring the tackling of the problem to a future version almost indefinitely. Now it is a bit late to make the right choices and with the NI focus shifting away from LabVIEW, things don't get easier either.

Rolf Kalbermatter
My Blog
Message 2 of 8
(3,612 Views)

Thanks for explanation. I did not change windows local language settings. Moeroever I have only Turkish language installed on my computer. This behaviour is really weird. I have never met such kind of issue before. Years ago I had similar issue but it was a generic unicode support problem and "UseUnicode = True" feature was solved it.

 

This time I can write special characters without any issue. But when I run the code they are displayed incorrectly. I never chage local language when I try this. After then I installed English langguage support. But it is not solved. It appears when I run the VI is really weird.

 

Now I am going to change windows language to English and change the region to US.

 

Do you have any suggestion?

0 Kudos
Message 3 of 8
(3,600 Views)

Most likely your constant is NOT set to be Unicode enabled. Since you run on a Turkish system that is perfectly fine as you use the codepage 1254 in that case and LabVIEW simply uses the Windows ANSI display functionality that translates the codepage 1254 bytes under the hood into the correct Windows 16 bit Unicode sequence (UTF16LE to be precise) and then displays it on the screen.

 

Now you pass this codepage 1254 byte stream to an indicator that you told to treat the incoming bytes as Unicode (in this case Unicode means UTF8 since LabVIEW is multiplatform and UTF16LE support is not available on many non-Windows platforms). That is an encoding mismatch. Your indicator has no idea what encoding the bytes in that pink wire are in and you told it "Sure believe me, it is Unicode (UTF8)", but it is NOT, it is codepage 1254. LabVIEW has no official encoding translation support either but the Unicode knowledge base article from where you got that INI file setting also has two functions to convert between the current codepage to Unicode UTF8 and vice versa. As mentioned, the problem is complicated and you need to make sure you get source and sink of a string to agree on the encoding or do according conversion yourself. LabVIEW is not going to hold your hands here and doesn't do these things automagically for you!

 

And changing your local settings to English won't solve anything, it will just make your constant display now as gibberish too, since the bytes you entered there before are now interpreted to be codepage 1252 (Western Europe) or maybe 1250 (Central Europe)

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 8
(3,593 Views)

@rolfk wrote:

Most likely your constant is NOT set to be Unicode enabled.


True,

I had no issue before. I am sharing Labview.ini file. Do you have any further suggestion how to fix this?

 

[LabVIEW]
UDCInstallID="ff82e6d0-78ab-4c58-b03a-41bcfe993f5a"
IsFirstLaunch=False
NI_GSWContentIndex=4
PaletteHidddenControlCategories_LocalHost="Control & Simulation;Signal Processing;Addons;User Controls;"
PaletteHidddenControlCategories_LocalHost_firstLaunch="Control & Simulation;Signal Processing;Addons;User Controls;"
PaletteHidddenFunctionlCategories_LocalHost="Vision and Motion;Favorites;User Libraries;"
PaletteHidddenFunctionlCategories_LocalHost_firstLaunch="Vision and Motion;Favorites;User Libraries;"
GSW_Pinned_Files="C:\Users\zafer\OneDrive\Projeler\Personal\ElitPack2\ElitPack2.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM Makine\Functions (V1)\Functions_V1.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\O-Key Dongle V2\O-Key Dongle V2.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\TCP Server\TCP Server.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM Makine\NRM_CIVATA_KONTROL.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\NRM.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Core Libraries.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Data Cache\Shared Data\Shared Data.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Custom Controls\QControls\QControls.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Data Cache\Ref Shared Data\Ref Shared Data.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Data Cache\Ref Shared Data\XControls\XControls.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Functions\Functions Parents 2\Functions Common.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Functions\Functions.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Data Cache\Job Collection.lvproj"
GSW_filter=0
GSW_Pinned_Templates=""
GSW_Pinned_Templates_names=""
NI_GSWPosition="852,411,1709,981"
menuSetup="default"
saveFloaterLocations=True
LastErrorListSize=0,0,649,484
SaveChanges_ApplyToAll=True
paletteStyle="NamedIcons"
NI_GSWContentExpanded=False
server.tcp.port=3364
server.tcp.enabled=True
server.tcp.access="+127.0.0.1;+localhost;+*"
defaultConPane="4834"
NewProj.maxNum=10
titlebarRevision=True
reqdTermsByDefault=True
SnapGridDrawAsLines=2
cleanupVisa=True
requireAutoTool=False
autoLayoutMaxSimplex=1000
autoLayoutMaxHeuristics=70
enableAutoWire=False
FancyFPTerms=False
autoInsertFeedbackNode=False
StructuresAutoSizeByDefault=False
ShowConstantFolding=False
ShowConstantFoldStructs=False
NISearchCategoryOrder="LvHelpSearch;LvPaletteSearch;Web Help;Support;Downloads;Product Information"
NewProj.RecentLocationPaths="C:\Program Files\National Instruments\LabVIEW 2021\ProjectTemplates\Source\Workers\Fundamentals Sample Project;C:\Program Files\National Instruments\LabVIEW 2021\ProjectTemplates\Source\Core\Blank Project;C:\Program Files\National Instruments\LabVIEW 2021\ProjectTemplates\Source\Delacor\Delacor QMH"
NewProj.RecentTitles="Workers Fundamentals;Blank Project;Delacor QMH"
RecentFiles.projectPathList="C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Functions\Functions.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Data Cache\Job Collection.lvproj;C:\Users\zafer\OneDrive\Projeler\Personal\ElitPack2\ElitPack2.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\NRM.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Data Cache\Shared Data\Shared Data.lvproj;C:\Users\zafer\OneDrive\Belgeler\LabVIEW Projects\Workers Fundamentals\Workers Fundamentals.lvproj;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Functions\Functions Parents 2\Functions Common.lvproj;C:\Program Files (x86)\MICRO-EPSILON Messtechnik GmbH u Co KG\TIM Connect\Connect SDK\LabView\IR Imager VIs\IR Imager\IR Imager.lvproj;C:\Program Files\National Instruments\LabVIEW 2021\instr.lib\IR Imager\IR Imager.lvproj;C:\Users\zafer\Downloads\TIM Connect Rel. 3.17.3097.0\SDK\connect sdk\LabView\IR Imager VIs\IR Imager\IR Imager.lvproj"
ProjectExplorer.ClassicPosition=45,39,1168,409
autoToolOn=False
AFProjectProvider.Actors=""
AFProjectProvider.ActorPaths=""
LVLibraryThemeColor=006699FF
IconEditor.FirstLaunch=False
RecentFiles.pathList="C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Functions\NRM Inner Thread_class\private\Calculate Side Fits and Center.vi;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Functions\Find Article_class\private\Calculate Intersections.vi;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Functions\Analytic Geometry_class\private\Calculate Intersection and Angle.vi;C:\Users\zafer\OneDrive\Projeler\Personal\ElitPack2\Modules\Label Printout\Label Printout\Load Tag Data.vi;C:\Users\zafer\OneDrive\Projeler\Personal\ElitPack2\Modules\Label Printout\Label Printout\Draw Printout Image (SubVI).vi;C:\Users\zafer\OneDrive\Projeler\Personal\ElitPack2\Modules\Label Printout\Label Printout\typedef_cls_Teaxt and Format.ctl;C:\Users\zafer\OneDrive\Projeler\Personal\ElitPack2\Modules\Label Printout\Label Printout\Actor Core.vi;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Functions\Analytic Geometry_class\protected\Get Output Data Core.vi;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Functions\Analytic Geometry_class\Destroy.vi;C:\Users\zafer\OneDrive\Projeler\Project Files\NRM\Functions\Analytic Geometry_class\protected\Add to UpdateRequests Core.vi"
NIERShowNonFatalDialogOnExit=false
NIERNonFatalAutoSend=true
NIERSendDialogClose=false
PropPageBounds="1287;621;1786;1082"
QuickDropDefObjShortcutsLoaded=True
QuickDropDiagramShortcuts="-inf:Negative Infinity;1dg:One Button Dialog;2as:Matrix Size;2dg:Two Button Dialog;3dg :Three Button Dialog.vi;aae:Add Array Elements;ac:Array Constant;ad1:Increment;as:Array Size;asb:Array Subset;atch:Match Pattern;athc:Path Constant;ats:Array To Spreadsheet String;avg:Mean.vi [NI_AALBase.lvlib];ba:Build Array;bath:Build Path;bbn:Bundle By Name;car:Compound Arithmetic;cbc:Color Box Constant;cbr:Call By Reference;cc:Cluster Constant;ccat:Concatenate Strings;cds:Conditional Disable Structure;cerr:Clear Errors.vi;cf:Close File;cmd:System Exec.vi;cr:Close Reference;crf:Open/Create/Replace File;cs:Case Structure;csc:Class Specifier Constant;cv:Current VI's Path;dbl:To Double Precision Float;dc:DBL Numeric Constant;dds:Diagram Disable Structure;dec:Decrement;dfa:Delete From Array;dq:Dequeue Element;dv:Divide;ea:Empty Array?;eath:Empty Path Constant;ec:Error Cluster Constant;ecf:Error Cluster From Error Code.vi;eq:Equal?;eqz:Equal To 0?;er:Error Ring;erg:Merge Errors;ess:Less?;esseq:Less Or Equal?;esseqz:Less Or Equal To 0?;essz:Less Than 0?;estr:Empty String/Path?;estrc:Empty String Constant;evstr:Event Structure;ext:To Extended Precision Float;fb:Feedback Node;fc:False Constant;fca:First Call?;fs:For Loop;fss:Flat Sequence Structure;fstr:Format Into String;fxp:To Fixed-Point;geq:Greater Or Equal?;geqz:Greater Or Equal To 0?;gr:Greater?;grz:Greater Than 0?;i16:To Word Integer;i32:To Long Integer;i64:To Quad Integer;i8:To Byte Integer;inf:Positive Infinity;mod:Quotient & Remainder;na:Initialize Array;nae:And Array Elements;nan:Not A Number/Path/Refnum?;nanc:Not A Number Constant;nc:Numeric Constant;ndx:Index Array;neq:Not Equal?;neqz:Not Equal To 0?;nes:In Place Element Structure;nq:Enqueue Element;nt:Not;nv:Invoke Node;qr:Quotient & Remainder;ra:Reverse 1D Array;ras:Replace Array Subset;rbf:Read from Binary File;rn:Property Node;rndd:Round Toward -Infinity;rndu:Round Toward +Infinity;rtf:Read from Text File;s1d:Search 1D Array;sath:Strip Path;sav:Select a VI...;sb:Subtract;sc:String Constant;se:Select;seng:String Length;serr:Simple Error Handler.vi;sgl:To Single Precision Float;sqr:Square Root;srt:Sort 1D Array.vim;sss:Search/Split String;sta:Spreadsheet String To Array;svr:Static VI Reference;tc:True Constant;tcase:To Lower Case;tct:Tick Count (ms);tra:Transpose 2D Array;tsc:To More Specific Class;tvar:To Variant;u16:To Unsigned Word Integer;u32:To Unsigned Long Integer;u64:To Unsigned Quad Integer;u8:To Unsigned Byte Integer;ubn:Unbundle By Name;vae:Or Array Elements;vc:Variant Constant;vr:Open VI Reference;vsr:VI Server Reference;vtd:Variant To Data;wat:Wait (ms);wbf:Write to Binary File;wc:Waveform Constant;ws:While Loop;wtf:Write to Text File;x:Multiply;xae:Multiply Array Elements;"
QuickDropPanelShortcuts="ac:Array;athc:File Path Control;athn:File Path Indicator;bc:Push Button;bn:Round LED;cb:Framed Color Box;cc:Cluster;cr:Control Refnum;en:Enum;erc:Error In 3D.ctl;ern:Error Out 3D.ctl;nc:Numeric Control;nn:Numeric Indicator;sac:Select a Control...;sc:String Control;sn:String Indicator;vr:VI Refnum;wc:Waveform Chart;wg:Waveform Graph;xg:XY Graph;"
QuickDropPosition="1276,866,1972,1329"
HiddenControlsVisibleWhileEditing=True
ChooseImplementationDialogSize="{2072,1050}"
DQMH.IncludeDoSomething.ProjectTemplate=True
NewProjectSpecPagePath="C:\Users\zafer\OneDrive\Belgeler\LabVIEW Projects\Workers Fundamentals"
DQMH.CustomEnqueueVISelected=False
DQMH.CreateTesterButton=False
colorHistoryItemA=01000016
colorHistoryItemB=00FF8000
colorHistoryItemC=00008000
autoerr=2
LogFileSaved=True
WatchWindowPos=117;1436;585;2224;119;122;1415;0;0;0;458;386;396
colorHistoryItemD=000080C0
NISearchForceExpand=1
colorHistoryItemE=00000000
NoAdvice070=",FlatSequence"
colorHistoryItemF=00E2E2E2
colorHistoryItemG=007F7F7F
colorHistoryItemH=00FAFAFA
colorHistoryItemI=00D2D2D2
colorHistoryItemJ=003A3A3A
colorHistoryItemK=00FFFF80
NI.LV.NewClass.SaveOption=0
NI.LV.NewClass.Size="743,312,1451,874"
CreateAccessor_Access=1
CreateAccessor_DynamicTerms=False
CreateAccessor_AdvancedVisible=True
CreateAccessor_ErrorTerms=False
find.searchStr="UI: Populate Tag Controls"
NewDlgRecentMainTemplates.pathList="C:\Program Files\National Instruments\LabVIEW 2021\templates\Frameworks\DesignPatterns\UserInterfaceEventPattern.vit"
NewDlgSmall=False
NewDlgCollapsed="77E350A8-F9AA-43FF-85E2-454279EBB9A7"
NewDlgLastSelected="2"
NewDlgBounds="1156;700"
NewDlgRecentTemplates.pathList=""
EventInspectorPosition.0="907,345,1654,1047"
EditEventsDlgSize=591,684,1262,1708
BookmarkManager.DoNotShowChooser=False
BookmarkManager.Preferred="C:\Program Files\National Instruments\LabVIEW 2021\resource\dialog\BookmarkManager\managers\Default\BMark_MainWindow.vi"
BookmarkManager.Choices="Default"
BookmarkManager.GroupByVI=False
BookmarkManagerWindow.position="848,446,1713,947"
LLBMgr_RecentPath="C:\Users\zafer\OneDrive\Projeler\Personal\ElitPack2\data\LabVIEW Blowfish Encryption.llb"
LLBMgr_ActivePlugins=""
DropSubdiagramLabelByDefault=True
ModernBD=True
CreateAccessor_WhichFolder="--- No Folder ---"
DragAdjustWires=False
FindProjectItems.MaxMRUDepth=10
FindProjectItems.MaxResults=2000
FindProjectItems.CaseSensitive=False
FindProjectItems.MatchWholeWord=False
FindProjectItems.RegularExpression=False
editRecentPaths="C:\Users\zafer\OneDrive\Projeler\Project Files\NRM Makine\Functions\Thread Distances.llb"
IconEditor.TextFont="Small Fonts"
IconEditor.TextAlignment=00000001
IconEditor.TextSize=00000009
IconEditor.Save3rdPartyTemplates=True
IconEditor.3rdPartyTemplatesFolderName="3rd party"
IconEditor.TextTab.Color1stBodyLine=00000000
IconEditor.TextTab.Color2ndBodyLine=00000000
IconEditor.TextTab.Color3tdBodyLine=00000000
IconEditor.TextTab.Color4thBodyLine=00000000
IconEditor.TextTab.TextFont="Small Fonts"
IconEditor.TextTab.TextAlignment=00000001
IconEditor.TextTab.TextSize=00000008
IconEditor.TextTab.Options=00000003
IconEditor.FillColor=00FF0000
IconEditor.EdgeColor=00FFFF80
IconEditor.Tool=00000003
IconEditor.ShowLayerTab=True
IconEditor.ShowTerminals=False
IconEditor.SaveLayersWithVI=False
IconEditor.MostRecentTab=00000003
IconEditor.Position="638,715,1614,1186"
recentUserName="zafer"
SuperSecretPrivateSpecialStuff=True
enableSecretPopups=True
find.findTextFlags=64506
server.viscripting.showScriptingOperationsInEditor=True
FontCodePageList=IDAutomationHC39M,1254
UseUnicode=True
colorPrinting=False
menuKeywordExtra=3
find.viListFlags=4

 

 

 

 

0 Kudos
Message 5 of 8
(3,584 Views)

@Zafer.Depe wrote:

@rolfk wrote:

Most likely your constant is NOT set to be Unicode enabled.


True,

I had no issue before. I am sharing Labview.ini file. Do you have any further suggestion how to fix this?


No! Considering that the constant and the indicator have NOT the same encoding setting, this is what I would expect. Why it would have worked like this before I don't know, it definitely shouldn't have! Sorry.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 8
(3,569 Views)

After I removed the line

 

UseUnicode=True

from Labview.ini file, one part of the issue is solved. Controls and constants seems working fine. Now I am getting nonsense charachters only at the title of the front panels. Also .Net components have the same effect.

 

Front Panel Title.png

 

 

 

0 Kudos
Message 7 of 8
(3,490 Views)
Solution
Accepted by topic author Zafer.Depe

The problem seems solved. It was not a Labview issue but Windows 11 Unicode UTF-8 support to worldwide language problem.

 

I unclicked this option and problem is solved.

 

UTF-8 Support.png

 

Turkish character support 2.png

 

0 Kudos
Message 8 of 8
(3,428 Views)