I have a QString which contains a japanese string. But while debugging its just showing "???" in place of string. I need it to display it in qml. I have used QtextCodec but didnt work for me. Please give any solution or suggestion to fix the issue.
Have you tried this?
label->setText(QString::fromLocal8Bit("日本語"));
Save source file in UTF-8 (or other which can encode your characters) encoding
Set default codec with QtextCodec (I've tried, and it is working without this setting, too).
Use label->setText(QString::fromWCharArray(L"日本語"));
Related
I removed this special character using string locator but still live on my site.
http://prntscr.com/ke7pby
It's just before my footer are.
Please refer to this answer :
Just use notepad ++ with encoding UTF-8 without BOM.
I am using wkhtmltopdf with wkhtmltoxsharp wrapper. When I try to convert HTML to "pdf" it converts it, but only when the text is latin. I cannot convert Cyrillic text, i get some strange characters.
Can you please help me, if you know any solution?
I have tested wkhtmltopdf with cyrilic, chinese and korean and they all work for me. Do you do the conversion on your desktop or on a server? It could be that the server does not have proper fonts the installed - that commonly causes this problem.
Also, it would help to see a little example of the content you are converting and the command (or piece of code) you use to convert.
I was doing a bunch of search-replace operations in notepad++ to effectively minify my css - mostly removing whitespace/tabs etc...) This ended up breaking much of my css.
Apparently a strange character (​) was inserted all over the place) Using notepad++ in UTF-8 without BOM, I cannot see these, but they appeared in a view-source.
I was able to remove these by doing a search replace in ANSI encoding, but my question is, what is this character, and why might it have appeared?
The string “​” is the UTF-8 encoded form of ZWSP when misinterpreted as windows-1252 encoded data. (Checked this using a nice UTF-8 decoder.) This explains why you don’t see it in Notepad++ in UTF-8 mode; ZWSP (zero-width space) is an invisible character with no width.
Apparently browsers are interpreting the style sheet as windows-1252 encoded. Saving the file with BOM might help, since then browsers would probably guess the encoding better. The real fix is to make sure (in a server-dependent manner) that the server sends appropriate Content-Type header for the CSS file.
But if this is the only non-Ascii character in your CSS file, it does not matter in practice, after you have removed the offending data.
I don’t know of any simple way to make Notepad++ insert ZWSP (you could of course use general character insertion utilities in the system), so it’s a bit of mystery where it came from. Perhaps via copy and paste from somewhere.
Using the web developer plug in or ext in Firefox you can see the problem character in the css document.
In Visual Studio all I could see was:
}
.t
Web developer showed an unwanted hidden character, an "a" with a caret on top:
}
â.t
The utf encoder link above revealed this
} (the encoded character for ampersand)
.t
and this
but simply fix the problem by deleting and retyping.
I'm having problems with Flex (3.5) auto converting "ü" into a "u". As soon as I paste the character in, it transforms.
Is there something I need to turn on to enable these other character sets? I thought Flex supported UTF-8?
Thanks!
Default setup on 3.3 which I use currently for german/english applciation doesn't behave like that. I made new dummy project and tried all text editable fields. Check Project Properties > Resource > Text file encoding and Flex compiler > Additional compiler arguments. If you didn't change anything there, than it's component you use.
EDIT: OR, maybe it's font, if you use custom font...
i had the same problem, german characters, but this problem was solved from ma PHP side developers, they did something, flex doesn't have n e problem in representing these special characters, so i was doin everything fine from ma side
What font are you using ? are you sure that the font is supporting those chars ? else you will get u or ? instead of ü.
Perhaps too simple a question, but what language(s) do you have set in the flex-config.xml file? There are a couple of places that this can be set, including the font table suggested by Adrian.
Use the Flash Text Laylout Framework as it supports the full character set. This means use Flex 4 and either <s:TextInput or s:TextArea or any other of the spark components that use the TLF.
You should check your default compiler args, the source file details and the html file your swf is embedded into, to make sure they use utf-8. also check the font type you are using, to see if the required characters are part of that set.
I'm using Response.WriteFile("mymenu.aspx") to write a plain text file out to an area in a MasterPage. Unfortunately it's also printing out an unknown character represented by the square character. The contents of the menu file are as followings:
<ul>
<li>Accounts</li>
</ul>
The square character is what is causing my menu to display incorrectly, pushing it down about 20 pixels. I tested putting just the HTML in the master page instead of including the file and it works fine which mean it must be down to the Response.WriteFile function. I don't suppose anyone else has encountered this problem?
EDIT: I tried the following as well, just to really make sure I wasn't doing anything stupid and that the file didn't contain anything dodgy.
<%
Dim tw As New System.IO.StreamReader(Server.MapPath("menu.aspx"))
For Each s As String In tw.ReadToEnd
Response.Write(s)
Next
%>
It worked. But that still doesn't explain Response.WriteFile behaviour.
Have a look at your text file in an editor that will show all characters including carriage returns, line feeds etc. (Notepad++ is my choice). File may have an unusual eof marker or other encoding issue from the software that created the file.
This sounds like a character encoding issue. Is this file in the same encoding as the page your using it from?
Edit
Open the file up in a hex editor make sure there are no weird characters in there.
I tested your code and it rendered correctly for me.
I have seen ASP.NET alter incoming XML strings in WebMethods before. Save the text to a file on disk before you Response.Write it to compare. Check your CSS for your LI style.