CharConversionException when displaying smart quotes

My servlets are throwing a CharConversionException when I attempt to display "smart quotes." The quotes and other symbols (i.e. long hyphen) are entered into an online form when a user composes something in Word 2000 then copies/pastes it into a text field. The servlet is able to get the parameter and update the MS SQL 7 database but not display the value back in the confirmation page. I am running this application on iPlanet web server v.6 SP 1. It seems to be related to my servlet engine as it doesn't have this problem when using the servlet runner (srun)--that will display the characters as a question mark. This is a set of �smart quotes� and a long�hyphen

problem solved:
1.- I changed the response content type of my Servlet to:
response.setContentType("text/html;charset=\"windows-1252\"");
2.- In my DB I changed the type of the field to the "nText" type which support more characters like Unicode, etc

Similar Messages

  • Smart quotes stored in DB are displaying as ? after jdbc select

    I originally posted this to the general forum, but it was suggested that I post it here where Sergiusz Wolicki from Oracle might be able to help.
    I have an Oracle 10 DB set up with the following character set
    NLS_LANGUAGE AMERICAN
    NLS_CHARACTERSET WE8MSWIN1252
    NLS_NCHAR_CHARACTERSET AL16UTF16
    I am connecting to the database using JDBC thin client. I have a web page that is encoded using
    <%@ page language="java" pageEncoding="Windows-1252" contentType="text/html;charset=Windows-1252" %>
    The scenarion I am having problems with is the following. In an input field the user copies a so-called smart quote from Word and submits. I then update the corresponding database field and then return to the page and display the result.
    If I display the string that I wrote to the database back in the page, without selecting it from the database, it displays correctly. However, if I select it from the database and then display it in the page I get a question mark ('?') - note that this is NOT the upside down variety.
    I believe it is inserting it into the database correctly. I can go into sql plus and do a select on the field and it appears to be correct. I can also use the ascii function and it shows the character as character 145. Here is what I did:
    select middle_name from employee where employee_id=100;
    MIDDLE_NAME
    select ascii(middle_name) from employee where employee_id=100;
    ASCII(MIDDLE_NAME)
    145
    So my problem is getting it out of the database and into a java string properly.
    I know I can solve this issue by changing the database character set to UTF-8, but I am not in control of this and it is not an option.
    Thanks in advance for any help on this.

    I suspect this may be the result of bug #4659157. Upgrade your JDBC driver to 10.2.0.4 or to any 11g driver and retest.
    -- Sergiusz

  • Suppress the single quote when display downloaded file in EXCEL

    I have a requirement to keep all the cells contents left-justisfied when display in EXCEL. I used GUI_DOWNLOAD and concatenate a single quotes to the numeric fields in my internal table. However, when open the file in EXCEL, the single quote show up in the cell also. Anyone knows how to suppress the single quote when open in EXCEL? Here are my codes:
    concatenate '''' itab-field2 into itab-field2.
    modify itab.
       CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
           filename                      = 'c:test_xls.xls'
           FILETYPE                      = 'ASC'
           WRITE_FIELD_SEPARATOR         = 'X'
         tables
           data_tab                      = itab.
    Thank you,

    Check the below program :
    REPORT ZJOINS message-id z01. .
    *REPORT ZTEST3 line-size 400.
    DATA : V_CHAR(1) TYPE C VALUE ''''.
    data : v_field(12) type c.
    data : begin of itab occurs 0,
           fld1(12) type c,
           end of itab.
    start-of-selection.
    v_field = '0000012345'.
    CONCATENATE V_CHAR  V_FIELD  INTO V_FIELD.
    itab-fld1 = v_field.
    append itab.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      BIN_FILESIZE                  = ' '
      CODEPAGE                      = ' '
        FILENAME                      =
        'C:\Documents and Settings\smaramreddy\Desktop\fff.xls'
       FILETYPE                      = 'ASC'
      MODE                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        DATA_TAB                      = itab
      FIELDNAMES                    =
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_WRITE_ERROR              = 2
       INVALID_FILESIZE              = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       OTHERS                        = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    I just tried one field in internal table,i am not sure this program help you
    Thanks
    Seshu

  • Smart quotes and em-dashes in epub file

    When I create an epub file from my InDesign book file, I find that sometimes (not always, thought!) my smart quotes and em-dashes revert to gibberish.
    For example, when I open the epub file, the em-dash is fine, but in chapter 2, it changes to —.
    Does anyone know how I might correct this?
    Thanks so much!

    It sounds like somethings wrong with the chapter's character encoding.  The character encoding is declared in the header of the ePub HTML. From ID it's:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    This test has UTF-8 declared in the first line of its source code:
    http://www.zenodesign.com/forum/encodetest/UTF8.html
    And this has no encoding
    http://www.zenodesign.com/forum/encodetest/None.html
    Most browsers let you override or choose the character set, so in Safari if you set the character set to View>Text Encoding>default, you'll see a difference between the above links, but if you set it to Unicode (UTF-8) they both display correctly. In FireFox it's View>Character Encoding.
    You can check and edit the contents of the .epub file by changing the extension from .epub to .zip, and then extracting the contents.

  • Convert smart quotes and other high ascii characters to HTML

    I'd like to set up Dreamweaver CS4 Mac to automatically convert smart quotes and other high ASCII characters (m-dashes, accent marks, etc.) pasted from MS Word into HTML code. Dreamweaver 8 used to do this by default, but I can't find a way to set up a similar auto-conversion in CS 4.  Is this possible?  If not, it really should be a preference option. I code a lot of HTML emails and it is very time consuming to convert every curly quote and dash.
    Thanks,
    Robert
    Digital Arts

    I too am having a related problem with Dreamweaver CS5 (running under Windows XP), having just upgraded from CS4 (which works fine for me) this week.
    In my case, I like to convert to typographic quotes etc. in my text editor, where I can use macros I've written to speed the conversion process. So my preferred method is to key in typographic letters & symbols by hand (using ALT + ASCII key codes typed in on the numeric keypad) in my text editor, and then I copy and paste my *plain* ASCII text (no formatting other than line feeds & carriage returns) into DW's DESIGN view. DW displays my high-ASCII characters just fine in DESIGN view, and writes the proper HTML code for the character into the source code (which is where I mostly work in DW).
    I've been doing it this way for years (first with GoLive, and then with DW CS4) and never encountered any problems until this week, when I upgraded to DW CS5.
    But the problem I'm having may be somewhat different than what others have complained of here.
    In my case, some high-ASCII (above 128) characters convert to HTML just fine, while others do not.
    E.g., en and em dashes in my cut-and-paste text show as such in DESIGN mode, and the right entries
        &ndash;
        &mdash;
    turn up in the source code. Same is true for the ampersand
        &amp;
    and the copyright symbol
        &copy;
    and for such foreign letters as the e with acute accent (ALT+0233)
        &eacute;
    What does NOT display or code correctly are the typographic quotes. E.g., when I paste in (or special paste; it doesn't seem to make any difference which I use for this) text with typographic double quotes (ALT+0147 for open quote mark and ALT+0148 for close quote mark), which should appear in source code as
        &ldquo;[...]&rdquo;
    DW strips out the ASCII encoding, displaying the inch marks in DESIGN mode, and putting this
        &quot;[...]&quot;
    in my source code.
    The typographic apostrophe (ALT+0146) is treated differently still. The text I copy & paste into DW should appear as
        [...]&rsquo;[...]
    in the source code, but instead I get the foot mark (both in DESIGN and CODE views):
    I've tried adjusting the various DW settings for "encoding"
        MODIFY > PAGE PROPERTIES > TITLE/ENCODING > Encoding:
    and for fonts
        EDIT > PREFERENCES > FONTS
    but switching from "Unicode (UTF-8)" to "Western European" hasn't solved the problem (probably because in my case many of the higher ASCII characters convert just fine). So I don't think it's the encoding scheme I use that's the problem.
    Whatever the problem is, it's caused me enough headaches and time lost troubleshooting that I'm planning to revert to CS4 as soon as I post this.
    Deborah

  • Smart quotes in languages other than English

    Hi to all,
    As a technical writer, I deal with texts in several languages. One of the problems I have with FrameMaker, is that French and German "smart" (or "typographic") quotes are not entered automatically. Quotation marks remain in the English format. The solutions offered in Adobe's Knowledge Base are less than optimal:
    - Replacing the way FrameMaker writes smart quotes in the Maker.ini file is made on a general base, and not per language.
    - Manually entering all quotation marks cannot be done easily when you receive a text from others.
    Is there a viable solution to this problem?
    Paolo

    Paolo,
    One way would be to create a small custom config file for each specific language that modifies the definition of the standard double-quote characters used for the Smart quotes. The definition for the standard characters in cmds.cfg  (in the \fminit\configui folder) is:
    <Command CharLeftDblQuote
        <Label Left Double Quote>
        <Definition \xd2>>
    <Command CharRightDblQuote
        <Label Right Double Quote>
        <Definition \xd3>>
    where the Definition parameter specifes the hex value (i.e. character in the FrameRoman encoding) to use for the character that you wish to display in FM.
    For the French, version create a file with those two entries (call it French_smartquotes.cfg) and change the hex values to the appropriate language-specific quote, i.e. guillemotleft is \xc7 and guillemotright is \xc8. Likewise for the German.
    Then, when you need to work in any of theose languages, use View > Menus > Modify... and select the appropriate .cfg file. This will then temporarily change the mapping for the double-quote characters such that when you enter them from the keyboard, the appropraite language specific quote will be used. To switch languages, simply select another .cfg file using the View > Menus > Modify... The setting only persists for the current FM session.
    The alternative is to edit the maker.ini file to enable the language specific smart quotes, listed in the [Spelling] section. The entry is:
    ; Smart Quote Characters
    ; SmartQuotes \xd4\xd5\xd2\xd3 )  English curved quotes
    ; SmartQuotes \xe2\xd4\xe3\xd2 )  German-style quotes with base quotes
    ; SmartQuotes \xd5\xd5\xc7\xc8 )  French-style quotes using guillemets
    ; SmartQuotes \xd5\xd5\xd3\xd3 )  Swedish- and Finnish-style quotes
    ; SmartQuotes \xd4\xd5\xd2\xd3 )  Italian curved quotes
    ; English curved quotes:
    SmartQuotes=‘’“”
    Delete the ";" at the front to un-comment the appropriate entry and add a ";" to the english one.
    However, this route requires you to close FM every time yo uwish to make a change.

  • Disabling Smart Quotes in FrameMaker 7.2

    Hi,
    My team uses FrameMaker 7.2 to create and edit DITA XML files. We recently noticed that the smart quote feature inserts non-printable characters in our XML content files. Our help system cannot display the characters properly, and so we've started to search for and replace the smart quote characters with straight quotes (outside of FrameMaker).
    The smart quote characters seem to be defined in the maker.ini file.
    ; Smart Quote Characters
    ; SmartQuotes \xd4\xd5\xd2\xd3 )  English curved quotes
    ; SmartQuotes \xe2\xd4\xe3\xd2 )  German-style quotes with base quotes
    ; SmartQuotes \xd5\xd5\xc7\xc8 )  French-style quotes using guillemets
    ; SmartQuotes \xd5\xd5\xd3\xd3 )  Swedish- and Finnish-style quotes
    ; SmartQuotes \xd4\xd5\xd2\xd3 )  Italian curved quotes
    ; English curved quotes:
    SmartQuotes=\xd4\xd5\xd2\xd3
    I've been searching unsuccessfully online for hex code characters to replace the smart quote characters with straight quotes. Does anyone here know which character codes to use?
    Incidentally, I've fiddled with the feature for disabling smart quotes per document (Format > Document > Text Options), but don't want my team mates to have to perform this task every time they open a file.
    Thanks,
    Mark

    Mark,
    the Text Options are stored with the FrameMAker file and since you are opening XML files the setting must be made once in the template used when opening XML files.
    As far as I know FrameMaker writes curly quotes as perfectly valid codepoints to XML, so it must be a weakness of your help system not being able to display those characters. There is nothing wrong with those characters. Have you found the problem there?
    - Michael

  • Microsoft Word "Smart Quotes"

    I hope this will save other developers some time.
    This may be obvious to others, but I just spent several hours Googling and testing to determine what actually happens when a user copies text containing "Smart Quotes" from Microsoft Word into a Java JTextComponent. For those not familiar with Smart Quotes, by default, MS Word changes double-quoted strings from using the US-ASCII character for quote (0x22) into left- and right- curly quotes (UTF-16: 0x201c and 0x201d). Word also does this with serveral other characters. This plays havoc with the display and Java Strings later encoded with java.beans.XMLEncoder, unless treated carefully. Here is what I discovered (obviously, this applies to MS Windows):
    All values are in hexadecimal.
    - Word is storing the character for double quote as UTF-16 internally (201C).
    - When the character is copied to the clipboard, it is copied as UTF-8 (E2 80 9C).
    - When the clipboard is pasted into Java, Java is assuming the it was originally Windows-1252 encoded, because that is the default for the US-EN locale in Windows XP (probably also Vista, but I only tested in XP).
    - Java translates this into a-circumflex, euro-sign, o-e-ligature, the characters corresponding to E2, 80, and 9C respectively in Windows-1252 and represents it internally in UTF-16 as 00E2 20AC 0153.
    -When the String is XML-encoded using java.beans.XMLEncoder, it is written in UTF-8 as C3A2 E282AC C593, which equates to UTF-16 00E2 20AC 0153 -- the characters a-circumflex, euro-sign, o-e-ligature.
    I am not sure how to fix this, but maybe another reader does. I am experimenting with the Clipboard (java.awt.datatransfer) to see if I can programmatically find out the original character encoding (in this case, UTF-16).

    Doesn't the DataFlavor contain the character encoding? What is the content of the InputStream returned by
                InputStream is = (InputStream)contents.getTransferData(DataFlavor.getTextPlainUnicodeFlavor());
    If I use
                    DataFlavor df = DataFlavor.getTextPlainUnicodeFlavor();
                    String mimeType = df.getMimeType();
                    String encoding = mimeType.replaceAll(".*?charset=(.*?)\\s*$", "$1");
                    InputStream is = (InputStream) contents.getTransferData(df);
                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    byte[] buffer = new byte[1024];
                    for (int count = 0; (count = is.read(buffer)) != -1;)
                        baos.write(buffer, 0, count);
                    baos.close();
                    result = baos.toString(encoding);to transfer
    Hello "World"
    which Word changes the quotes to the smart 'smart quotes' version I get as a result
    Hello “World”
    which is what I expect.
    Am I missing something?
    Edited by: sabre150 on Sep 4, 2009 1:27 PM

  • Characters such as apostrophes and smart quotes turning into boxes or question marks

    We recently upgraded from CF5 to CF7 and are having a problem
    with previously saved text that no longer displays correctly. Some
    characters (apparently, non-ASCII characters such as curly
    apostrophes and smart quotes) are rendering as boxes or question
    marks. We recently upgraded to Oracle 10g from Oracle 8i, but this
    problem appears to be independent of the database that the text is
    stored in. Here is sample code that will illustrate the problem:
    <CFSET string1="Department’s">
    <CFSET string2="hey—there">
    <CFOUTPUT>
    string1 is #string1#
    <BR>
    string2 is #string2#
    </CFOUTPUT>
    output looks like this:
    string1 is Department?s
    string2 is hey?there
    These are rendered as boxes when viewed in Internet Explorer.
    (They show up as question marks when I copy and paste them here.)
    The Demoronize UDF helps *some* of the time, but this is
    still happening with a lot of text, especially text that gets
    pasted from a website into a form, then saved to a database. Does
    anybody have a solution for this? This is breaking my applications
    and is incredibly annoying. I'd like to either replace the
    problematic characters at the time they are displayed, or replace
    them when they are input in the database in the first place (and go
    back and update all the previously saved data to replace the
    problematic characters with plain text equivalents).
    Any suggestions appreciated.

    I finally isolated the problematic characters so I edited the
    DeMoronize UDF (available at cflib.org) by adding the following
    text replacements at the bottom:
    text = Replace(text, chr(8208), "-", "ALL");
    text = Replace(text, chr(8209), "-", "ALL");
    text = Replace(text, chr(8210), "&ndash;", "ALL");
    text = Replace(text, chr(8211), "&ndash;", "ALL");
    text = Replace(text, chr(8212), "&mdash;", "ALL");
    text = Replace(text, chr(8213), "&mdash;", "ALL");
    text = Replace(text, chr(8214), "||", "ALL");
    text = Replace(text, chr(8215), "_", "ALL");
    text = Replace(text, chr(8216), "&lsquo;", "ALL");
    text = Replace(text, chr(8217), "&rsquo;", "ALL");
    text = Replace(text, chr(8218), ",", "ALL");
    text = Replace(text, chr(8219), "'", "ALL");
    text = Replace(text, chr(8220), "&ldquo;", "ALL");
    text = Replace(text, chr(8221), "&rdquo;", "ALL");
    text = Replace(text, chr(8222), """", "ALL");
    text = Replace(text, chr(8223), """", "ALL");
    text = Replace(text, chr(8226), "&middot;", "ALL");
    text = Replace(text, chr(8227), "&gt;", "ALL");
    text = Replace(text, chr(8228), ".", "ALL");
    text = Replace(text, chr(8229), "..", "ALL");
    text = Replace(text, chr(8230), "...", "ALL");
    text = Replace(text, chr(8231), "&middot;",
    "ALL");

  • My iPhone 5 won't display smart text options.

    My iPhone 5 won't display smart text. It did when I initially downloaded the new OS, now those options don't appear at all. Did I click something to make them disappear?
    I went into Settings to see if there was a component of it within Messages. I don't see anything.
    Thoughts please.....
    Thanks much
    Ginger

    Awwww......that's it....the dash! I tapped it. Tried to drag it up/down and it didn't move. Now I swiped and it's back!
    So I need to remember to drag up/down and now swipe.....
    Thanks much!
    Ginger

  • Find and replace smart quotes with straight quotes?

    I understand I can turn off smart quotes so that I can type straight quotes, but I need to replace hundreds of curly smart quotes with straight quotes, is there a feature that will let me do this? I am using FM8.
    Thanx,
    Willian

    I am using FM9....so I don't know if the same shortcuts apply, but this is what I found out last week.
    Use the Find and Replace tool:
    With smart quotes turned off and the Num Lock key turned on:
    Alt0147 will give you beginning quotation marks
    Alt0148 will give you ending quotation marks
    In the Find box use ALT0147 or ALT0148 for the beginning or ending quotes. When you click in the box and type
    one of the shortcuts the correct quote will be shown in the box.
    In the replace box type the regular straight quotes on your keyboard.
    I was thrilled that it would work!...course you do have to do them separately and be careful not to replace the curly quotes
    that you want to leave in your document.
    Hope this helps using FM8....
    ls

  • Preview and "Smart" quotes

    I am trying to search through a PDF document that contains some (unfortunately named) "smart quotes". The term I am searching for is "Dean's", however the document contains "Dean’s". The quote mark in the second word is actually a multibyte Unicode character.
    Is there a way to configure Preview, or the Mac in general, to ignore these differences when performing searches? That is, to find "Dean’s" even when I'm looking for "Dean's"? As a human, there's essentially no difference between the two.

    Is there a way to configure Preview, or the Mac in general, to ignore these differences when performing searches?
    I think not, they represent two different character streams. You probably need to search for both if you don't already know which of them the text uses.
    But some apps may do this automatically. I think Pages, for example, may find both kinds of punctuation when you put either in the Edit > Find dialogue.

  • Problem with javascript/PHP/ oracle 10g smart quotes

    I have a problem with my php form that passes the text field to a javascript object. When I copy text from MS Word that includes smart quotes, the form inputs that into the database as ? (upside down) marks. The charset of the DB is WE8MSWIN1252. How do I store these smart quotes as regular quotes? And also if I can do any conversions on the front end (js or php). I tried doing some conversion but to no avail. Any help would be appreciated thank you. “double”

    Decide if you want your HTML pages in Windows code page 1252 or Unicode UTF-8. Then, make sure the pages are properly tagged as either "text/html;charset=windows-1252" or "text/html;charset=utf-8". Use HTTP header Content-type or the corresponding <META HTTP-EQUIV=...> tag. Then, set NLS_LANG environment variable for your PHP engine to either AMERICAN_AMERICA.WE8MSWIN1252 or to AMERICAN_AMERICA.AL32UTF8, depending on which encoding you selected for your HTML.
    -- Sergiusz

  • Auto-smart quotes in Mountain Lion.

    Being kind of a weirdo, one huge draw to OS X for a long while now has been its ability to automatically turn dumb quotes into smart quotes. 
    That is,
    " " into “ ” .
    Just a bit of a typographical quirk I have.
    Anyway, since getting Mountain Lion, this function simply doesn't work as it should.  When it is simply enabled in the [edit > substitutions] menu, nothing happens.  So, I found out, that when you go into the [edit > show substitutions] menu, you can get it to work if you have 'text replacement' checked.  However, with one monstrous caveat: after the quotes get changed to smart ones, weird stuff starts to happen. In contractions, the cursor will move to the letter directly adjacent to the new smart quote.  E.g. in the word I've, the cursor will move between the v and e after you hit the spacebar; in the word don't, it'll move next to the t.
    In essence, it makes the function totally useless because it turns typing into a total hassle.  I swear it didn't do this in one of the earlier versions of 10.8, but it sure does now.  Perhaps someone knows of a way to fix this?  Or is it simply a bug that slipped through the cracks because it's a pretty esoteric feature?
    I guess the only other option is to stop being so ridiculous, but now why would I want to do that?

    I, too, am having the same problem – except I am using Lion (10.7.5).  If I remember correctly, this was a problem even in 10.7.4.  Totally aggravating for us weirdos.  I just can’t tell if the problem has to do with Safari (or other applications) or whether it is an operating-system-wide setting/problem.  I have tried a few different trouble-shoots – combinations of the “System Preferences” panel and “Substitutions” from within Safari – but all to no avail.

  • German smart quotes on English UI

    Hi,
    I need to write German letters on my MacBook Air, whose language settings are set to English (US). The problem is that even when spell check is set to German, the smart quotes still appear as the should in the English language. I originally was a Windows user and when I use MS Word to type, it automatically detects document language and formats text accordingly. The following is what shows up when I use Word on Windows:
    „Guten Morgen“, sagte der Bäcker.
    “Good morning”, said the baker.
    When I use any writing software on Mac, though, it shows up like this (and even in retrospect, there doesn't seem to be a way to change it):
    “Guten Morgen”, sagte der Bäcker.
    “Good morning”, said the baker.
    I understand that in OS X, software-specific language settings depend on the system language. Coming from Windows, I'm surprised that there is no way to set document language in OS X. Or is there?
    What do I need to do to type a German letter, complete with all German symbols, but without having to switch system language every time? I'm sure I'm not the only one with this problem, but I could not find any good ideas on how to solve my problem. I hope you can help me.
    Best wishes.
    Nils

    How about an OS X service that works in any application, and will place Gänsefüßchen around any selected text string. What if you selected the text, and then pressed control+Q, and the quotes were inserted around the selected text? You may also find this a useful tool.
    Open Automator, New Document, and Service.
    In the left Automator panel select Library > Utilities > Run AppleScript.
    Drag and drop the Run AppleScript action into the larger workflow window to the right.
    Select and remove the contents of that Run AppleScript window.
    Copy/Paste the AppleScript code from below into the Run AppleScript window
    Click the hammer in the Run AppleScript toolbar
    Service receives text from any application
    Output replaces selected text
    Automator > File > Save...
    Give your script a meaningful name. I called mine Gänsefüßchen.
    It is written into your <login>/Library/Services folder
    In System Preferences > Keyboard > Shortcuts > Services
    Scroll down in the right window until your assigned service name appears
    On the right side where it says none, click once, and it will change to an add shortcut button.
    Type control and Q which will appear as ^Q. Press return. Exit System Preferences.
    Exit any running application where you might use this. Then restart the application.
    With your text selected, press control+Q to get the Gänsefüßchen.This service item appears under Application Name > Services too.
    Automator Service Gänsefüßchen
    AppleScript code
    on run {input, parameters}
      -- we want to insert german quotes around the selected text
      tell application "System Events"
      set links_zitat to "„"
      set recht_zitat to "”"
      set german_quotes to ""
      set german_quotes to links_zitat & input & recht_zitat
      set input to german_quotes
      end tell
      return input
    end run

Maybe you are looking for