Print Page | Close Window

special unicode characters in XAML

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: MarkupLabel Control
Forum Description: Topics Related to Codejock MarkupLabel Control
URL: http://forum.codejock.com/forum_posts.asp?TID=23077
Printed Date: 03 December 2024 at 12:38pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: special unicode characters in XAML
Posted By: ElvisM
Subject: special unicode characters in XAML
Date Posted: 13 July 2016 at 7:23pm
Another thing...

Iam working with accent letters (Á, á, Ë, e, Ñ, ñ, etc) but markip fails if you use this special characters... Confused

I read some post, and I saw that for special characters as "&", "<", ">", "/", etc, you can solve it using escape words as &amp, &it, &gt, etc... However if you try to use the escape words for accents, they dont work, markup fails... 

Is there either a solution or tip for this behavior?


Best regards,


-------------
Product: Xtreme SuitePro (ActiveX) version 17.2
Platform: Windows 10 64bits
Language: Visual Basic 2015



Replies:
Posted By: olebed
Date Posted: 17 July 2016 at 7:31am
Hello ElvisM,

I think you forgot something from declarations in XAML, see our sample 

c:\Program Files (x86)\Codejock Software\ActiveX\Xtreme SuitePro ActiveX v17.2.0\Samples\Common\VB\MarkupSample\frmMain.frm

See using MarkupLabel1.
<!-- xaml code from VB MarkupSample samle -->
<Border xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' Background="Yellow">

<ScrollViewer HorizontalAlignment="Center" VerticalAlignment="Center" VerticalScrollBarVisibility="Auto">
<StackPanel TextElement.FontSize="14" TextElement.FontFamily="Tahoma" Background="LightGreen">
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Arabic"/>             <TextBlock Text="مـرحبــاً"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Danish"/>             <TextBlock Text="Velkommen"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Dutch"/>             <TextBlock Text="Welkom"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="English"/>             <TextBlock Text="Welcome"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Farsi"/>             <TextBlock Text="خـوش آمديـد"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="French"/>             <TextBlock Text="Bienvenue"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Gaelic"/>             <TextBlock Text="Fбilte"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="German"/>             <TextBlock Text="Willkommen"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Greek"/>             <TextBlock Text="Καλώς ήλθατε"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock Width= "100" Text="Gujarati"/>             <TextBlock Text="આવો યઘારો"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Hebrew"/>             <TextBlock Text="בִּרוּבִים חַבָּאִים"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Hindi"/>             <TextBlock Text="रवागत"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Italian"/>             <TextBlock Text="Benvenuto"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Japanese"/>             <TextBlock Text="よろてそ"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Korean"/>             <TextBlock Text="여보세요"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Polish"/>             <TextBlock Text="Witamy"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Portuguese"/>             <TextBlock Text="Bemvindo"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Punjabi"/>             <TextBlock Text="ਜੀ ਆਇਆਂ ਨੂੰ"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Russian"/>             <TextBlock Text="Добро пожаловать"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Simplified Chinese"/>             <TextBlock Text="欢迎"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Slovak"/>             <TextBlock Text="Vнtame vбs"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Spanish"/>             <TextBlock Text="Bienvenido"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Traditional Chinese"/>             <TextBlock Text="歡迎"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Turkish"/>             <TextBlock Text="Hoş geldiniz"/></StackPanel>
<StackPanel Orientation="Horizontal"><TextBlock MinWidth= "100" Text="Welsh"/>             <TextBlock Text="Croeso"/></StackPanel>
</StackPanel>
</ScrollViewer>

</Border>


<!-- also xaml code from MFC samle -->
<?xml version='1.0' encoding='utf-8'?>
<Border xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' 
Background='#eeffee' BorderBrush='#999999' BorderThickness='1'>
<ScrollViewer>
<StackPanel TextElement.FontFamily='Tahoma' Margin='4'>
<TextBlock TextWrapping='Wrap'><Bold>Markup supports Unicode text in ANSI applications.<LineBreak/>Use UTF-8 encode to enter it:</Bold></TextBlock>
<TextBlock TextWrapping='Wrap'><Italic>Languages:</Italic> العربية (ar) • Azərbaycan (az) • Български (bg) • Català (ca) • Česky (cs) • Deutsch (de) • Ελληνικά (el) • English (en) • Esperanto (eo) • Español (es) • فارسی (fa) • Suomi (fi) • Français (fr) • 日本語 (ja) • 한국어 (ko) • Lietuvių (lt) • മലയാളം (ml) • Македонски (mk) • नेपाल भाषा (new) • ਪੰਜਾਬੀ (pa) • Polski (pl) • Português (pt) • Română (ro) • Русский (ru) • Svenska (sv) • தமிழ் (ta) • ไทย (th) • Türkçe (tr) • Українська (uk) • Tiếng Việt (vi) • 中文 (zh)</TextBlock>
</StackPanel>
</ScrollViewer>"
</Border>"

Regards,
 Oleksandr Lebed


Posted By: jpbro
Date Posted: 17 July 2016 at 10:23am
Make sure you are using the Unicode version of the control, and then just use the actual characters "Á, á, é, É, Ñ, ñ" or Chr$W() control codes.


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: leandro@tecware.com.
Date Posted: 16 December 2017 at 7:59am
Hello.
I am building a report using MARKUP LABEL and PRINT PREVIEW for printing.
The Portuguese language is full of accents.
When I use accents, MARKUP works correctly, but when sending to PRINT PREVIEW printing does not work because PRINT PREVIEW does not carry accents.
To solve I had to build the MARKUP string in UTF-8 and use UTF-8 in PRINT PREVIEW and ANSI in MARKUP.
I believe this is not the best practice.

Looking at the MARKUP PAD (EXE) I realized that I can write an ANSI XAML and that the print works correctly.
I also noticed that the PRINT PREVIEW menu is disabled initially, but after some time it enables.
This gave me the impression that there is some kind of ANSI CONVERTER for UTF-8 to allow PRINT PREVIEW to work correctly.

I also noticed that the MARKUP PAD (VBP - Visual Basic 6) does not have the same behavior, forcing me to write in UTF-8 and then convert to ANSI
as mentioned initially.

The question is:
How can MARKUP PAD (exe) be able to receive ANSI text and print correctly?
Does it convert from ANSI to UTF-8?
How can we do this conversion?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net