How can i show accented characters with hotstrings? - utf-8

How can i display the chraracters with accent, hotstrings autohotkey.
Is not displaying the correct text...
For example, look the code:
#SingleInstance Force
#NoTrayIcon
#NoEnv
:*O:compraplatina::Olá, como vai? +{Enter} VocÊ quer troféus? Não será feito dessa forma, razoável
The result when i type "compraplatina":
image

Related

Qml strange behavior with cyrillic symbols

I am experiencing very strange behavior with cyrillic letters. I'm using Qt 5.12.6, Windows 10 (64 bit).
The whole application wrote with QML, as you can see some words don't make any sense they are not Russian. All QML Text elements behave the wrong way.
The top login buttons underlied red look like this
import QtQuick 2.7
import QtQuick.Controls 2.0
Button {
id: loginPageButton
font.capitalization: Font.AllUppercase
checkable: true
flat: true
contentItem: Text {
text: loginPageButton.text
font: loginPageButton.font
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
}
using
LoginPageButton {
id: newAccountButton
text: qsTr("CREATE AN ACCOUNT")
font.pixelSize: 16
ButtonGroup.group: btnGroup
checked: false
Layout.alignment: Qt.AlignCenter | Qt.AlignVCenter
}
retranslate is made in such way
QGuiApplication::removeTranslator(&m_currentTranslator);
bool isLoaded = m_currentTranslator.load(QString("tr_%1").arg(locale), QCoreApplication::applicationDirPath() + "/translations/");
if (isLoaded)
QGuiApplication::installTranslator(&m_currentTranslator);
m_engine.retranslate(); // QQmlApplicationEngine
and i have to say that the bug is reproduced only on some machines not all...
A "Ḱ" indicates Macedonian language. So your string encoding is wrong, if you want Russian.
Quoting from the Qt docs:
"The application may occasionally require encodings other than the default local 8-bit encoding. For example, an application in a Cyrillic KOI8-R locale (the de-facto standard locale in Russia) might need to output Cyrillic in the ISO 8859-5 encoding. Code for this would be:
QString string = ...; // some Unicode text
QTextCodec *codec = QTextCodec::codecForName("ISO 8859-5");
QByteArray encodedString = codec->fromUnicode(string);
For converting Unicode to local 8-bit encodings, a shortcut is available: the QString::toLocal8Bit() function returns such 8-bit data. Another useful shortcut is QString::toUtf8(), which returns text in the 8-bit UTF-8 encoding: this perfectly preserves Unicode information while looking like plain ASCII if the text is wholly ASCII.
For converting the other way, there are the QString::fromUtf8() and QString::fromLocal8Bit() convenience functions, or the general code, demonstrated by this conversion from ISO 8859-5 Cyrillic to Unicode conversion:
QByteArray encodedString = ...; // some ISO 8859-5 encoded text
QTextCodec *codec = QTextCodec::codecForName("ISO 8859-5");
QString string = codec->toUnicode(encodedString);
" (1)

TypeError: "embedded NUL character" to stick little pictures on a white picture

I want to create a "DOBBLE" game, but,
to create a DOBBLE card game, I just want to put some symbols (little pictures) on a bigger, but the Shell return this:
"embedded NUL character".
My program is:
def creer_carte(L):
S=associer() #a list of little pictures' link : ['1.jpg','2.jpg',..]
size=(700,450) #dimension de l'image finale
newim=Image.new('RGB',size,"white") #on créé une image vide
newim.save("carteblanche.jpg", "PNG")
for i in range(len(L)):
A=open(S[L[i+1]],encoding='latin-1').read()
img=Image.open(A) #On télécharge le fichier
newim.paste(img,(i*200,0))
newim.show()
return None
...It's only the beginning of my program.

How can I set a special character(right arrow) in UILabel?

I am trying to set a text in UILabel, like this
mylabel.text = #"▶ section1";
but, the right arrow character is translated to audio player icon inside UILabel.
Is there a way to print right arrow character intactly as it is.
Thank you.
Try using unicode:
mylabel.text = #"\u25BA section 1";

Attribute concatenation with multiple Theme Classes in SD app

I am creating a SD App in GX Ev3, and am working on a list.
I came across a requirement for the App and don't know how to do it.
I have to concatenate some Attributes in a String, but one of them (&Status) has to be Font Bold.
&Status + ', por ' + &User + ' em ' + &Date
Possible results:
'OK, por User1 em 01/07/2014'
'Com problema #5, por User2 em 01/07/2014'
'Por validar, por User3 em 01/07/2014'
How can I do it, so it looks like continuous text?
You can do that by using a variable based on the Html domain, and using HTML formatting for the value (i.e. "<b>OK</b>, por ...").
This will create a WebView to display the text, achieving the effect you want.
However, WebViews are unfortunately more resource-intensive than edits, so using them inside a grid is not recommended. We hope to provide a better solution soon.
I would do the HTML field as matiash suggested
But if you want other solution you could do a User Control that can help you.
In an application we have been developing for iOS we have done this using the NSAttributeString.
https://developer.apple.com/library/ios/documentation/cocoa/reference/foundation/classes/NSAttributedString_Class/Reference/Reference.html
What we did is:
&varUC = "#"+&Status +"# my middle text 1 #" + &User + "# my middle text2 #"+&Date+"#"
In our UC we separated the string by the "#" and we changed the the color and weight of those words, then remove the # when displaying the text.
For Android, we haven't done this yet, but with a quick Google search I think you should use:
how to change text color in the middle of the sentence in android
Doing a User Control for GeneXus Smart Devices is really easy ->
http://wiki.genexus.com/commwiki/servlet/hwikibypageid?15301
You can try using the tag "after" in the definition of the class, but you'll have to split the atribute.
Your best bet is to split the variables on the screen, both with distinct classes:
&Status &Text
&Status = 'OK'
&Text = ', por'+&User+' em '+&date
The css sample below is used to automatically set bold fields and (*) on the label of required fields:
.RequiredDataDescription:after
{
font-size: 11px;
font-weight: bold;
color: #333333;
content:" (*)";
}

Why does -[NSTextStorage replaceCharactersInRange: withAttributedString:] sometimes, sometimes not honor fonts in other character sets?

I'm trying to diagnose a problem in UKSyntaxColoredTextDocument 0.4 http://www.zathras.de/angelweb/blog-uksctd-oh-four.htm where text that actually lives in a different font than the one you have specified disappears as you type. (You can download and try out this cool utility to see this problem for yourself...)
Here's the background: This is some syntax coloring code that recolors as you type. It works great, but if you enter some characters that are not a part of the font set for that text view (e.g. Monaco, Helvetica) ... for instance, a symbol character or something in Japanese, which actually uses fonts like ZapfDingbatsITC or HiraKakuProN-W3 to display it, then those characters are not displayed as you type.
Let's say you have some text like this: fdsafd[☀]sfds‡[☀☀☀][日本語]...
If you paste that into the text field, and switch among syntax coloring from the popup, this invokes oldRecolorRange:, with this line:
[[textView textStorage] replaceCharactersInRange: range withAttributedString: vString];
Here, things behave as I would expect. The ASCII text, the symbols, and the Japanese text are all visible. The value of [textView textStorage] starts out, and ends up, something like this: (This is output of gdb; it's not showing the unicode characters, don't worry about that.)
df{
NSFont = "LucidaGrande 20.00 pt. P [] (0x001a3380) fobj=0x001a4970, spc=6.33";
}?{
NSFont = "ZapfDingbatsITC 20.00 pt. P [] (0x001ae720) fobj=0x001bb370, spc=5.56";
}fdsafd[{
NSFont = "LucidaGrande 20.00 pt. P [] (0x001a3380) fobj=0x001a4970, spc=6.33";
}?{
NSFont = "HiraKakuProN-W3 20.00 pt. P [] (0x001b59e0) fobj=0x001bb600, spc=6.66";
}]sfds[{
...
... even after setting the new value to be
dffdsafd[?]sfds[???][???] Nihddfdfffdfdd{
NSFont = "LucidaGrande 20.00 pt. P [] (0x001a3380) fobj=0x001a4970, spc=6.33";
}
In other words, the "foreign" fonts needed to display this string are preserved automatically somehow, even though the fonts are not specified in the replacement string.
However, when you type in one character at a time, a different call of replaceCharactersInRange:withAttributedString: in the method recolorRange: results in an attributed string that is only in the base font -- no foreign-character fonts have been added for us, so the characters out of the range of the main font are not visible at all!
dffdsafd[?]sfds[???][???] Nihddfdfffdfddx{
NSFont = "LucidaGrande 20.00 pt. P [] (0x001a3380) fobj=0x001a4970, spc=6.33";
}
Any idea why this method would be working one way in one circumstance and not in another? Is there some kind of switch that I can pass to give the NSTextStorage/NSAttributedString a hint that we want the text to display foreign characters?
Try [[textView textStorage] fixFontAttributeInRange:range]; after the [[textView textStorage] replaceCharactersInRange: range withAttributedString: vString] in recolorRange:
I think the problem is editing the text storage again in response to processEditing, which is already the tail end of an edit. -[NSTextStorage processEditing] uses fixFontAttributeInRange:, but since you're trying to edit again, something is going wrong and the fix behavior is being dropped.
When you do it for the whole document, there is a normal beginEditing/endEditing/processEditing sequence which causes fixFontAttributeInRange: to be called happily.

Resources