Umlauts encoding in ImpEx - sap-commerce-cloud

In my project,there are some German Umlauts like ä, ö, ü.When these are imported as a part of a name(like aüa),it is replaced via a weird ? symbol.This issue is intermittent on several releases in higher environment.How to sort this issue out?

Did you try to see if the UTF-8 format is set for the file?
Right click on the file in the Package Explorer view and press Preferencies.

make sure your impex file is UTF-8 encoded
make sure your JVM encoding for the hybris server is set to UTF-8 (property tomcat.generaloptions=... -Dfile.encoding=UTF-8 ...
make sure your database stores UTF-8 correctly (all tables have correct encoding configured)

Try this:
ä = "ä"
Überblick => Überblick

Related

Javascript export CSV encoding utf-8 and using excel to open issue

I have been reading quite some posts including this one
Javascript export CSV encoding utf-8 issue
I know lots mentioned it's because of microsoft excel that using something like this should work
https://superuser.com/questions/280603/how-to-set-character-encoding-when-opening-excel
I have tried on ubuntu (which didn't even have any issue), on windows10, which I have to use the second posts to import, on mac which has the biggest problem because mac does not import, does not read the unicode at all.
Is there anyway I can do it in coding while exporting to enforce excel to open with utf-8? or some other workaround I might be able to try?
Thanks in advance for any help and suggestions.
Many Windows applications, including Excel, assume the localized ANSI encoding (Windows-1252 on US Windows) when opening a file, unless the file starts with byte-order-mark (BOM) code point. While UTF-8 doesn't need a BOM, a UTF-8-encoded BOM at the start of a file clues Excel that the file is UTF-8. The byte sequence is EF BB BF and the equivalent Unicode code point is U+FEFF.

delete special characters preceding shebang (M-oM-;M-?#!/bin/bash) [duplicate]

I have a CSV file with special accents and save it in Notepad by selecting UTF-8 encoding. When I read the file using Java, it reads the BOM characters too.
So I want to save this file in UTF-8 format without appending a BOM initially in Notepad.
Otherwise, is there a built-in class in Java that eliminates the BOM characters that present at beginning, when reading the contents in a file?
Use Notepad++ - it is free and much better than Notepad. It will help to save text without a BOM using Encoding → Encode in UTF-8 without BOM: Notepad++ v6 and olders:
Notepad++ v7+:
When I encountered this problem in Java, I didn't find any library to parse these first three bytes (BOM). So my advice:
Use PushbackInputStream(in, 3).
Read the first three bytes
If it's not BOM (EF BB BF), push them back
Process the stream as UTF-8
I just learned from this Stack Overflow post, as #martin-geisler points out, that you can save files without the BOM in Windows Notepad, by selecting ANSI as the encoding.
I'm assuming that for more advanced uses this won't work because the resulting file is probably not the end encoding wished, but actually ANSI; but I tested and confirmed this works to save a very small .php script without BOM using only Notepad.
I learned the long, hard way that Windows' Notepad is not a true editor, although I'd like to point out for others that, despite this, it is misleadingly called up when you type "editor" on newer Windows machines, at least on one of mine.
I am currently using Emacs and other editors to solve this problem.
Use Notepad++ instead. See my personal blog post on it. From within Notepad++, choose the "Encoding" menu, then "Encode in UTF-8 without BOM".
Notepad on Windows 10 version 1903 (May 2019 update) and later versions supports saving to UTF-8 without a BOM. In fact, UTF-8 is the default file format now.
Reference: Windows 10 Notepad is Getting Better UTF-8 Encoding Support
The answer is: Not at all. Notepad can't do that.
In Java you can just skip the first byte in your InputStream and be done.
You might want to try out Notepad2 or Notepad++. Those Notepad replacements have the option for you to choose whether to output BOM.
As for a Java solution, as far as I know, Java does not understand the standard UTF-8. I googled and found Java's UTF-8 and Unicode writing is broken - Use this fix that might be the solution.
We're using the utility BOMStripperInputStream.java to strip the BOM from our input if present.

String unknown Eclipse

I've changed the encoding from Eclipse but all my strings with special characters now are like this "�". The old encoding was the Default (Cp1252), now it is UTF-8. How can I fix the strings with special characters?
Thanks.
Well, imagine you switch your brain to only understand Chinese. Could you read an English text anymore?
You changed the way Eclipse interprets the bits of your sourcecode. So you need to translate the sourcecode from Cp1252 to UTF-8.
I don't know if Eclipse is able to do this, but Notepad++ is.
Open a java-file you want to change the encoding of in Notepad++.
Click on Encoding
Select Convert to UTF-8
Save the file
When you now click on Encoding again, there should be a dot in front of Encode in UTF-8
Edit: Notepad++ recognizes the used encoding, so you can read it there. Copy and Paste from Notepad++ to Eclipse won't work, because you copied the same string Eclipse couldn't read. You have to change the encoding of the string.

Questions on Chinese Encoding

I'm trying to create a webpage in Chinese and I realized that while the text looks fine when I run it on browsers, once I change the Character Encoding, the text becomes gibberish. Here's what's happening:
I create my html file in Emacs, encoded in UTF-8.
I upload it to the server, and view it on my browsers (FF, IE, Chrome, Opera) - no problem.
I try to view the page in other encodings via FF > View > Character Encoding > All those different Chinese encoding systems, e.g. Chinese Simplified (HZ)
Apart from UTF-8, on every other encoding the text becomes gibberish.
I'm assuming this isn't a problem - i.e. browsers are smart enough to know which encoding the page is in, and parse the content accurately. What I'm wondering is why I can't read the Chinese text anymore once I change encoding - is it because I don't have Chinese fonts installed on my OS? Should I stick to UTF-8 if my audience are Chinese or should I choose among one of their many encoding systems?
Thanks in advance for your help/opinions.
UTF isn't a 'catch-all' encoding. It's designed to contain international language character symbols for ease of use, but it is still an encoding, just like the other encodings you've selected. You would have to retype the text in each encoding to make it appear correctly when viewed with that encoding.
Viewer encoding MUST match the file being read. Viewing UTF-8 as something other makes about same sense as renaming .txt to .exe and trying to run it.
You should specify correct encoding in HTML. The option you're using in web browser exist only for those rare occasions when web developer screwed up his job and declared other encoding than actually used OR mixed up 2 different encodings on one page.
Of course changing the encoding in your browser will "break" the text! The browser is taking the stream of UTF-8 codepoints and tries to force another encoding on the raw data. Needless to say, the result ain't pretty. Changing the encoding in the browser is NOT the equivalent of converting.
As you surmised correctly, modern browsers usually guess correctly -- but not always. As Agent_L make sure to declare the encoding in the headers.

Any other text editor can edit the UTF8 text (like "\u7F51\u7BA1\u7CFB" in those *.perpertis file) created by netbeans

Guys,
I am looking for a text editor or method to deal with the UTF8 encoded *.properties file created by the Netbeans (6.x and 7.0.x). Trust me I have tried Notepad++, PsPad, gVim, jedit, etc without luck. Or I have just missed somehing?
The items is in the form of followings:
update.text=\u4FEE\u6539
The reason for this is I am trying to use script to modify some property items during the build process.
At the moment only Netbeans itself can read and display the content correctly. Any ideas?
Thanks.
David
I use WinVi, which supports UTF-8, UTF-16, and hex/binary editing.

Resources