utf

idn_to_ascii() in 5.2.17

旧巷老猫 提交于 2021-02-20 11:50:45
问题 There's a very handy function idn_to_ascii() in PHP 5.3, but I'm running 5.2.17 and I can't change that. How do I encode Unicode domain names to ascii then? 回答1: Peter's answer gives you the official IDN functions in PHP 5.2, and if possible it's probably the best answer. However some users will be unable to install a PECL library on their PHP system, so they would need to have a conversion library written in plain PHP which they can just include within their own code. Fortunately there is a

What is the Best UTF [closed]

送分小仙女□ 提交于 2021-02-18 10:26:06
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . I'm really confused about UTF in Unicode. there is UTF-8, UTF-16 and UTF-32. my question is : what UTF that are support all Unicode

corrupted UTF characters in pdf plots generated by R

女生的网名这么多〃 提交于 2021-02-10 14:48:52
问题 I am trying to save plots with legends containing UTF characters for Males and Females to pdf in R . When I plot to graphics device : plot(1) legend('topright', bty = 'n', expression(italic("legend"~"\u2640"~"\u2642"))) the legend of plot looks as expected I can even save it to pdf by right click and "save to pdf". However, when I use inbuilt function pdf pdf('test.pdf') plot(1) legend('topright', bty = 'n', expression(italic("legend"~"\u2640"~"\u2642"))) dev.off() it drops a warning and

How can I decode this string in python?

ⅰ亾dé卋堺 提交于 2021-02-08 23:44:13
问题 I downloaded a dataset of facebook messages and it was formatted like this: f\u00c3\u00b8rste student It's supposed to be første student but I cant seem to decode it correctly. I tried: str = 'f\u00c3\u00b8rste student' print(str) # 'første student' str = 'f\u00c3\u00b8rste student' print(str.encode('utf-8')) # b'f\xc3\x83\xc2\xb8rste student' But it did't work. 回答1: To undo whatever encoding foulup has taken place, you first need to convert the characters to the bytes with the same ordinals

PDFBox U+00A0 is not available in this font's encoding

≯℡__Kan透↙ 提交于 2020-08-04 04:24:57
问题 I am facing a problem when invoking the setValue method of a PDField and trying to set a value which contains special characters. field.setValue("TEST-BY (TEST)") In detail, if my value contains characters as U+00A0 i am getting the following exception: Caused by: java.lang.IllegalArgumentException: U+00A0 is not available in this font's encoding: WinAnsiEncoding A complete stracktrace can be found here: Stacktrace I currently have set PDType1Font.TIMES_ROMAN as font. In order to solve this

PDFBox U+00A0 is not available in this font's encoding

倾然丶 夕夏残阳落幕 提交于 2020-08-04 04:24:51
问题 I am facing a problem when invoking the setValue method of a PDField and trying to set a value which contains special characters. field.setValue("TEST-BY (TEST)") In detail, if my value contains characters as U+00A0 i am getting the following exception: Caused by: java.lang.IllegalArgumentException: U+00A0 is not available in this font's encoding: WinAnsiEncoding A complete stracktrace can be found here: Stacktrace I currently have set PDType1Font.TIMES_ROMAN as font. In order to solve this

Python psycopg2 not in utf-8

自作多情 提交于 2020-03-18 05:20:05
问题 I use Python to connect to my postgresql data base like this: conn=psycopg2.connect(database="fedour", user="fedpur", password="***", host="127.0.0.1", port="5432") No problem for that. But when I make a query and I want to print the cursor I have something like this: "Fran\xc3\xa7ois" instead of "François" and it cause problem when I want to create a XML document with this. I thkink is come from my encodage, but I found any solution. I try to encode('utf-8') but doesn't work. I have also

PHP MySQL database strange characters

匆匆过客 提交于 2020-01-24 04:22:07
问题 I'm trying to output product information stored in a MySQL database, but it's writing out some strange characters, like a diamond with a question mark inside of it. I think it may be an encoding/UTF8 issue, but I've specified the encoding I want: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Is this right? What should I check for? 回答1: If only the data that's coming from database has strange characters in it, be sure that the MySQL connection is also in UTF8 by using:

how to determine text encoding

荒凉一梦 提交于 2020-01-13 02:39:27
问题 I know UTF file has BOM for determining encoding but what about other encoding that has no clue how to guess that encoding. I am new java programmer. I have written code for guessing UTF encoding using UTF BOM. but I have problem with other encoding. How do I guess them. Anybody can help me? thanks in Advance. 回答1: This question is a duplicate of several previous ones. There are at least two libraries for Java that attempt to guess the encoding (although keep in mind that there is no way to

Encoding Issue in Talend Open Studio

你说的曾经没有我的故事 提交于 2020-01-06 19:48:12
问题 I am working on a Talend Project, Where we are Transforming data from 1000's of XML files to CSV and we are creating CSV file encoding as UTF-8 from Talend itself. But the issue is that some of the Files are created as UTF-8 and some of them created as ASCII , I am not sure why this is happening The files should always be created as UTF. 回答1: As mentioned in the comments, UTF8 is a superset of ASCII. This means that the code point for any ASCII characters will be the same in UTF8 as ASCII.