character-encoding

PHP and character encoding problem with  character

我与影子孤独终老i 提交于 2020-01-14 10:46:27
问题 I'm having a problem where PHP (5.2) cannot find the character 'Â' in a string, though it is clearly there. I realize the underlying problem has to do with character encoding, but unfortunately I have no control over the source content. I receive it as UTF-8, with those characters already in the string. I would simply like to remove it from the string. strpos(), str_replace(), preg_replace(), trim(), etc. Cannot correctly identify it. My string is this: "Â Â Â A lot of couples throughout the

Cannot insert character '≤' in SQL Server 2008

烂漫一生 提交于 2020-01-14 10:26:07
问题 I have a SQL Server 2008 database and a nvarchar(256) field of a table. The crazy problem is that when I run this query: update ruds_values_short_text set value = '≤ asjdklasd' where rud_id=12202 and field_code='detection_limit' and then select * from ruds_values_short_text where rud_id=12202 and field_code='detection_limit' I get this result: 12202 detection_limit = asjdklasd 11 You can see that the character ≤ has been transformed in = It's an encoding related problem, for sure, in fact, if

Set request character encoding of JSF input submitted values to UTF-8 in GlassFish

99封情书 提交于 2020-01-14 09:16:10
问题 I have a problem with the values inserted in all my <h:inputText> fields. Some characters are not encoded in the right way. E.g. if I put ciò in the input field I get ciò . How can I allow a user to insert text with those characters and save them correctly? The problem in not in the DB encoding since I already have the wrong value before inserting it in the DB. I'm using JSF 2 with Facelets and GlassFish as application server. 回答1: You need to tell Glassfish to use UTF-8 to decode paramters

Illegal characters in filenames of a .jar file which android studio is not accepting

末鹿安然 提交于 2020-01-14 07:02:49
问题 I wanted to use StanfordCoreNLP library in my android app . So i have imported the .jar files using the following dependencies in my gradle.build file . These are my gradle dependencies The Files are imported properly but many of the files in the .jar file have ':' character in their names which the android studio wont accept .You can see the names here . Filenames with invalid characters in .jar file So i got an error as below when i tried to make the project . com.android.build.api

Illegal characters in filenames of a .jar file which android studio is not accepting

假装没事ソ 提交于 2020-01-14 07:02:17
问题 I wanted to use StanfordCoreNLP library in my android app . So i have imported the .jar files using the following dependencies in my gradle.build file . These are my gradle dependencies The Files are imported properly but many of the files in the .jar file have ':' character in their names which the android studio wont accept .You can see the names here . Filenames with invalid characters in .jar file So i got an error as below when i tried to make the project . com.android.build.api

let htmlspecialchars use UTF-8 as default charset?

笑着哭i 提交于 2020-01-14 03:36:07
问题 Is there a way to tell PHP to use UTF-8 as default for functions like htmlspecialchars ? I have already setted this: ini_set('mbstring.internal_encoding','UTF-8'); ini_set('mbstring.func_overload',7); If not, please can you post a list of all functions where I need to specify the charset ? (I need this because I am re-factorizing all my framework to get working with UTF-8) 回答1: Just use htmlspecialchars() instead of htmlentities() . Because it doesn't touch the non-ASCII characters, it doesn

Php email sent with issues on subject chars in Outlook only

帅比萌擦擦* 提交于 2020-01-13 20:16:13
问题 Im sending a mail using php, and the subject of the mail has accents. Im receiving weird characters in Outlook instead the accented chars. If i see the email in a web email client i see the subject perfect. This is the code that im using to send the email: $to = 'whateveremail@whatever.com'; $subject = '[WEBSITE] áccent – tésts'; $message = '<p>Test message</p> $headers = 'MIME-Version: 1.0' . "\r\n"; $headers.= 'From:equipothermomix@thermomix.com' . "\r\n"; $headers.= 'Content-type: text

Rails + Ruby 1.9 “invalid byte squence in US-ASCII”

泪湿孤枕 提交于 2020-01-13 19:11:42
问题 After upgrading to ruby 1.9 we began to notice pages failing to render from the rails template renderer when a user used a non-ASCII character. Specifically "é". I was able to resolve this issue on one of our staging servers, but I have not been able to reproduce the fix on our production server. The fix that seemed to work the first time: Converted the database from latin1 to utf8 using the convert_charset tool available here: http://www.mysqlperformanceblog.com/2009/03/17/converting

Rails + Ruby 1.9 “invalid byte squence in US-ASCII”

淺唱寂寞╮ 提交于 2020-01-13 19:10:31
问题 After upgrading to ruby 1.9 we began to notice pages failing to render from the rails template renderer when a user used a non-ASCII character. Specifically "é". I was able to resolve this issue on one of our staging servers, but I have not been able to reproduce the fix on our production server. The fix that seemed to work the first time: Converted the database from latin1 to utf8 using the convert_charset tool available here: http://www.mysqlperformanceblog.com/2009/03/17/converting

Why is this string not equal when it is decrypted a second time with AesCryptoServiceProvider?

天涯浪子 提交于 2020-01-13 17:07:14
问题 I'm having trouble with encryption and decryption of text in C# (VS2012, .NET 4.5). Specifically, When I encrypt and subsequently decrypt a string, the output is not the same as the input. However, bizarrely, if I copy the encrypted output and hardcode it as a string literal, decryption works. The following code sample illustrates the problem. What am I doing wrong? var key = new Rfc2898DeriveBytes("test password", Encoding.Unicode.GetBytes("test salt")); var provider = new