character-encoding

iOS - Unicode numeric value of individual characters in a string

我们两清 提交于 2019-12-25 04:05:49
问题 For Objective-C in iOS: If I have a string how could I read the unicode numeric value of an individual character? For example if my string was: "∆" That unicode character is U+0394, so how could I read the string, figure out the "0394" then create a new string with say 100 added to that value, so the new string would be the character U+0494 or "ҕ" Thanks! 回答1: First, there is a fallacy in your logic. ∆ + 100 != ҕ . Unicode is evaluated in base-16 (hex), so '∆' is actually equal to 916 in

How to pass a latin1 charset associative array from php to javascript?

为君一笑 提交于 2019-12-25 03:54:25
问题 The problem is that I have latin1 charset in db. The default output is utf-8 in php. even when i am using php iconv, it returns null as the new string is supposedly already utf-8. Converting DB would need downtime. I cant use json_encode because the string is malformed utf-8 containing �. I need an alternative to temporarily fix the issue without having to migrate the db. I need to transfer the associative array back to JS. I am using Ajax for getting the data. 回答1: You could convert the

Colorbox URL Params for Facebook Like

独自空忆成欢 提交于 2019-12-25 03:35:27
问题 I have an issue of passing the ? and = through my url since I am using drupal (although i think it doesn't matter drupal or static site). Each media content type I have needs a path of localhost/media/video?open=?cbox10 Pathauto module has this for each media asset content type. media/videos?open=?cbox[nid] The node url then looks like http://localhost/media-gallery/images%3Fopen%3D%3Fcbox14 Let me know if I'm wrong but i believe I need to now encode/decode the url using php. Each of these

html-encode output && incorrect string error

风格不统一 提交于 2019-12-25 03:27:08
问题 my data includes arabic characters which looks like garbage in mysql but displays correctly when run on browser. my questions: how do i html-encode the output? if i add this to all my files: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> i get this error: Error: Incorrect string value: '\xE4\xEE\xC3\xD8\xEF\xE6...' for column 'cQuotes' at row 1 i'm working on php/mysql platform. insertion form in html: <!doctype html> <head> <meta http-equiv="Content-Type" content="text

Java, convert string to a RSA publicKey

删除回忆录丶 提交于 2019-12-25 03:24:30
问题 i am trying ton convert a string representation of a public key into a publicKey java object use to encrypt data but i keep getting the following error below: java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: IOException: Detect premature EOF at sun.security.rsa.RSAKeyFactory.engineGeneratePublic(RSAKeyFactory.java:188) at java.security.KeyFactory.generatePublic(KeyFactory.java:304) at com.josh.crypto.CryptoUtil.convertKeytoKeyObject(CryptoUtil.java:96) at com

How to convert special characters in HTML using PHP?

我的梦境 提交于 2019-12-25 03:19:07
问题 Im looking to convert special characters like smart quotes to HTML entities but without converting other HTML markup because I need HTML markup to work. For example, convert <div>NVH “noise”</div> to <div>NVH “noise” issues<div> Its strange that if I log this on my local environment I get “noise” with smartquotes but on server I got ?noise?. My local runs LAMP with php56. server ran 54 and 55. I upgraded to 56 still no luck. I think either something in php configuration or among other things.

Set the default encoding to UTF-8 for all JSPs without using @page directives

谁说我不能喝 提交于 2019-12-25 03:06:06
问题 What I would like to avoid is specifying a page directive at the beginning of every JSP. As I understand, without the following line, the default for the Content-Type for the page will be set to "text/html;charset=ISO-8859-1". <%@ page contentType="text/html; charset=UTF-8" %> Is there a configuration option that does the same thing without having to explicitly set the charset for every single JSP file in an application? 回答1: You can add the following to web.xml <jsp-config> <jsp-property

Defining accent characters in different platforms under java

徘徊边缘 提交于 2019-12-25 02:55:14
问题 I have a problem with the accent character in different platforms. When I log this in my machine under fedora (where default charset is UTF-8) it is printing correvtly as Sacré Coeur. But when i update to another server that is running on RedHat (where default charset is ISO-8859-1), it is printing as Sacré Coeur. I want to log it in RedHat server as same as in my my Fedora machine. How can I do this? My Workout : I tried to changes the System.setProperty("file.encoding", "ISO-8859-1"); in

Problems with passing Euro Sign as URL parameter

岁酱吖の 提交于 2019-12-25 02:44:31
问题 I am trying to pass the Euro ( € ) sign as url parameter in my spring jsp. What is the right way to do so ? I tried the following with no avail. Problem is the character is getting encoded properly but not getting decoded from my destination jsp. I am using <%@page contentType="text/html;charset=UTF-8" %> Here is the calling jsp: <script> ... // params contains the euro sign document.location='dest.jsp?p='+escape(params); In the dest.jsp <input type="hidden" id="par" value="${param.p}"> and

Problems with passing Euro Sign as URL parameter

不羁岁月 提交于 2019-12-25 02:44:12
问题 I am trying to pass the Euro ( € ) sign as url parameter in my spring jsp. What is the right way to do so ? I tried the following with no avail. Problem is the character is getting encoded properly but not getting decoded from my destination jsp. I am using <%@page contentType="text/html;charset=UTF-8" %> Here is the calling jsp: <script> ... // params contains the euro sign document.location='dest.jsp?p='+escape(params); In the dest.jsp <input type="hidden" id="par" value="${param.p}"> and