encoding

Is it possible to get collisions with base64 Encoding / Decoding

陌路散爱 提交于 2019-12-24 03:38:44
问题 A similar question was asked here: Is base64 encoding always one to one And apparently the answer (to the similar question) is YES. I already know that, BUT I'd be curious to know the explanation for why these two strings appear to be equivalent after being Base64 decoded: cwB0AGQAAG== cwB0AGQAAA== One more thing... when you select the de-coded string then recode, both re-encode to the same value: cwB0AGQAAA== What happened? 回答1: base64 is not one-to-one; there are multiple ways to encode the

Can't display german umlauts even if UTF-8 is set wherever possible

♀尐吖头ヾ 提交于 2019-12-24 03:25:07
问题 Let me explain situation closer. Im working on some old company server with PHP 4. There is Windows 2000NT installed and a databaze that I can open with Microsoft Access 2000. There is no any option to set character encoding (unlike in phpMyAdmin), but I can read that characters in MS Access properly. Im extracting data from that database in my .php files and displaying it on my website, but characters like: ü, ä, ß are displayed wrong, like this: � All php/html files are saved by some old

Overcome Encoding Problems with PHP, SoapServer, UTF-8, and non English Characters?

谁说胖子不能爱 提交于 2019-12-24 03:19:26
问题 I'm having problems getting PHP to play nicely with SoapServer + UTF-8. Anytime anyone sends a Soap Request with non english characters (i.e. funny quotes, accented characters, etc) the SoapServer throws an exception saying "Bad Request." I've tried decoding the request with utf8_decode and even HTML Special Characters encoded the text. Nothing is working for me. I'm looking for a point in the right direction because I'm lost at the moment. 回答1: make sure both SoapServer and SoapClient are

Python kludge to read UCS-2 (UTF-16?) as ASCII

守給你的承諾、 提交于 2019-12-24 03:09:27
问题 I'm in a little over my head on this one, so please pardon my terminology in advance. I'm running this using Python 2.7 on Windows XP. I found some Python code that reads a log file, does some stuff, then displays something. What, that's not enough detail? Ok, here's a simplified version: #!/usr/bin/python import re import sys class NotSupportedTOCError(Exception): pass def filter_toc_entries(lines): while True: line = lines.next() if re.match(r""" \s* .+\s+ \| (?#track) \s+.+\s+ \| (?#start)

Thymeleaf encoding issues with javascript (using spring mvc)

别说谁变了你拦得住时间么 提交于 2019-12-24 02:56:22
问题 I am using spring mvc + thymleaf v3 and have an encoding issue when it comes to some data in the javascript defined in the html head section. Here is the javascript as defined in the head : function addtab(count) { var closetab = '<a href="" id="close'+count+'" class="close">×</a>'; $("#tabul").append('<li id="t'+count+'" class="ntabs">Tab '+count+'  '+closetab+'</li>'); $("#tabcontent").append('<p id="c'+count+'">Tab Content '+count+'</p>'); The problem is that the apostrophes used to escape

Encoding Problem when filling out a text_field with Watir in Ruby

烈酒焚心 提交于 2019-12-24 02:56:06
问题 I'm using Watir to fill out a text_field with the html-code that I have scraped with another program before. The language of the website-content that I'm transfering is German, so there are some special characters involved, that don't exist in the English alphabet. Those characters are displayed properly in the html-file, but when transfered into the text_field of the Joomla installation (I'm transfering a website to Joomla with this program), the special characters are not displayed properly

SQL Server 2005 - character encoding issue

筅森魡賤 提交于 2019-12-24 02:10:48
问题 I'm trying to store this value : țșșțșțșțșîăâ./,șllkoăîâ= into a column in SQL Server. The column is nvarchar(1000) and the insert statement looks like N'țșșțșțșțșîăâ./,șllkoăîâ=' But the data inside is still showing up like : ?????????îaâ./,?llkoaîâ= Any ideas on what I could try ? EDIT I just realized that I had changed the datatype in the database , but the linq2sql mapping remained with varchar instead of nvarchar. That's what was causing the issue - I only saw that after trying the

Generate javadoc for classes that have non-ascii charaters in their names

喜你入骨 提交于 2019-12-24 01:54:46
问题 Some of the classes in our code base have Unicode (Danish) characters in their names. It works fine for compilation and deployment, but it failed when generating Javadoc complaining about wrong characters in the java sources. We are using Gradle to build our code base and the following options actually solved the problem with wrong characters: javadoc { options.encoding = "UTF-8" } But that still fails on finding classes that have non-ASCII characters in their names: javadoc: error - File not

Why does Internet Explorer encode the URL differently when Control-clicking a link

前提是你 提交于 2019-12-24 01:46:08
问题 I'm facing a problem where Internet Explorer (10, but I think I have the same issue with older IEs) will encode a URL differently based on if I click a link normally or if I open it in a new tab by Control-clicking on it. I have made small JSBin to test the issue, and this is what Wireshark shows when I click the link normally : This is what I get when control-clicking : Notice that the "Å" in the URL is encoded differently, "\305" in the first case, and "\303\205" in the second. How to

Audio File Encoding and Decoding

送分小仙女□ 提交于 2019-12-24 01:17:40
问题 What is the efficient way to encode and decode an audio file in android I have tried the Base64 as below but after decoding the file size get increased. Encode ByteArrayOutputStream objByteArrayOS = new ByteArrayOutputStream(); File file = new File(path); FileInputStream objFileIS; try { objFileIS = new FileInputStream(file); byte[] byteBufferString = new byte[1024]; for (int readNum; (readNum = objFileIS.read(byteBufferString)) != -1;) { objByteArrayOS.write(byteBufferString, 0, readNum);