Perl utf8 binmode unexpected results

Why does binmode as raw produce the umlaut? Could any elaboration be given regarding how 'Zurich' String is stored internally in Perl? Just a little lost. use strict; use warnings; my $filename = "result-test-encoding-raw.xml"; open(my $fh,'>', ...
more »

2017-09-05 22:09 (2) Answers

Is this a valid UTF8 character in this xml file?

I have received some XML from an upstream data source. I'm not sure if these weird characters are valid UTF8 -or- the upstream source has messed things up. i.e. Bad data in => bad data out. I'm guessing the following is what was passed down: Val...
more »

2017-09-05 08:09 (1) Answers

Encoding of special properties in Eclipse

I have an application which uses swedish language in some java and jsp pages. Swedish words are described in file and those names will be used in the application. Application Screen: Words which are defined in the propert...
more »

2017-09-03 22:09 (4) Answers

Ascii code of music clef in Safari on iphone

I can't figure out how to display ascii code &#119070 (music clef) on my web page in safari on iphone. I left out ; at the end on purpose, so you can see what the code is. It works in Safari on Mac and in all other browsers. All the other codes ...
more »

2017-08-15 20:08 (1) Answers

How to check if a UTF-8 string starts with an 'a'

I have a UTF-8 string given as a null-terminated const char*. I would like to know if the first letter of this string is an a by itself. The following code bool f(const char* s) { return s[0] == 'a'; } is wrong, as the first letter (grapheme clu...
more »

2017-06-19 21:06 (4) Answers

SimpleXML changing file encoding

I am trying to write a function which could read an existing XML file and create a new one with all the data from the first one, but in a different encoding. As far I understand it, SimpleXML saves the file in UTF-8 encoding. My original XML file is ...
more »

2017-06-07 13:06 (2) Answers

Send arrow character to iPhone with SMS

I'm trying to send an up arrow to an iPhone with SMS using VBA and a CDO mail object. 'tried as Unicode: subj = ChrW(8593) & " Up " & ChrW(8593) 'also as HTML special character: subj = "↑ Up ↑" These result in either a ...
more »

2017-05-12 02:05 (1) Answers

XML to CSV using XSLT - preserve polish letters

I'm converting XML to CSV using XSLT. My output line in XSLT is: <xsl:output method="text" encoding="UTF-8" /> There is a lot of polish letters in XML, that's the problem. When I transform the XML from Notepad++ using XML tools plugin, the ou...
more »

2017-05-05 15:05 (1) Answers

Java - Fastest way to check the size of String

I have the following code inside a loop statement. In the loop, strings are appended to sb(StringBuilder) and checked whether the size of sb has reached 5MB. if (sb.toString().getBytes("UTF-8").length >= 5242880) { // Do something } This wo...
more »

2017-04-24 13:04 (4) Answers

Zend: UTF-8 encoding

My job is to migrate our current website to production. (I'm not the developer of the zend app). It's a french app, so we use a lot of french characters like "é" Our database collapse is utf8_bin (all). If I use a form for uploading data (for exam...
more »

2017-04-13 03:04 (0) Answers

Decode String with swift 3

I got the following encoded string in my web service response \U00e0\U00aa\U0095\U00e0\U00ab\U0083\U00e0\U00aa\U00aa\U00e0\U00aa\U00be \U00e0\U00aa\U0095\U00e0\U00aa\U00b0\U00e0\U00ab\U0080\U00e0\U00aa\U00a8\U00e0\U00ab\U0087 \U00e0\U00aa\U009f\U0...
more »

2017-03-15 07:03 (1) Answers

What is a safe length of JavaScript strings?

Considering charAt(), charCodeAt(), and codePointAt() I find a discrepancy between what the parameter means. Before I really thought about it I thought you would always be safe to access the character at length-1. But I read the difference between ...
more »

2017-03-10 03:03 (2) Answers