Save to html using utf 8Oracle PL/SQL UTL_FILE.PUT bufferinghow to fetch cursor value into varchar2 in pl/sqlHow could i send more than 32,767bytes?UTL_FILE.WRITE_ERROR when calling utl_file.put in a loopWrapping a Stored ProcedureHow to call a function defined in a PL/SQL package with SQLAlchemy?BULK COLLECT into table of objects inside LOOP?Create a package that has three public procedures named proc 1, etcPLW-07204: conversion away from column type may result in sub-optimal query plan how to handle itretrieve os file in oracle apex report

Why is the Digital 0 not 0V in computer systems?

POSIX compatible way to get user name associated with a user ID

Has SHA256 been broken by Treadwell Stanton DuPont?

Is there any reason to concentrate on the Thunderous Smite spell after using its effects?

What is the mathematical notation for rounding a given number to the nearest integer?

Would it be unbalanced to increase Wild Shape uses based on level?

Can I conceal an antihero's insanity - and should I?

Which is the current decimal separator?

Is low emotional intelligence associated with right-wing and prejudiced attitudes?

Why the car dealer is insisting on loan instead of cash

Ambiguity in notation resolved by +

Is "you will become a subject matter expert" code for "you'll be working on your own 100% of the time"?

Are there any “Third Order” acronyms used in space exploration?

What are examples of experiments or studies where pre-registration would not be feasible?

Parallel resistance in electric circuits

Why don't Wizards use wrist straps to protect against disarming charms?

How to be sure services and researches offered by the University are not becoming cases of unfair competition?

If the gambler's fallacy is false, how do notions of "expected number" of events work?

Interaction between Teferi Time Raveler and Enduring Ideal

Does a succubus' charm end when it dies?

Reading double values from a text file

Bit one of the Intel 8080's Flags register

What organs or modifications would be needed for a life biological creature not to require sleep?

sed replacing character in a file



Save to html using utf 8


Oracle PL/SQL UTL_FILE.PUT bufferinghow to fetch cursor value into varchar2 in pl/sqlHow could i send more than 32,767bytes?UTL_FILE.WRITE_ERROR when calling utl_file.put in a loopWrapping a Stored ProcedureHow to call a function defined in a PL/SQL package with SQLAlchemy?BULK COLLECT into table of objects inside LOOP?Create a package that has three public procedures named proc 1, etcPLW-07204: conversion away from column type may result in sub-optimal query plan how to handle itretrieve os file in oracle apex report






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I need to save a html file as utf 8. This is not about . Is this possible? In short my procedure is like this:



CREATE OR REPLACE PROCEDURE MY_PROCEDURE
IS

vFil UTL_FILE.FILE_TYPE;
vFilNavn varchar2(250);
vLinje varchar2(32767);

begin
vFil := UTL_FILE.FOPEN ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767);
UTL_FILE.PUT_LINE(vFil,vLinje);
end;

FOR recB in (select row from (my_html_content) );

loop
vLinje := recB.Rad;
UTL_FILE.PUT_LINE(vFil,substr(vLinje,1,32767));
end loop;

UTL_FILE.FCLOSE(vFil);
UTL_FILE.FRENAME('MY_DIRECTORY',vFilNavn||'.tmp', 'MY_DIRECTORY',vFilNavn||'.html',TRUE);









share|improve this question






























    0















    I need to save a html file as utf 8. This is not about . Is this possible? In short my procedure is like this:



    CREATE OR REPLACE PROCEDURE MY_PROCEDURE
    IS

    vFil UTL_FILE.FILE_TYPE;
    vFilNavn varchar2(250);
    vLinje varchar2(32767);

    begin
    vFil := UTL_FILE.FOPEN ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767);
    UTL_FILE.PUT_LINE(vFil,vLinje);
    end;

    FOR recB in (select row from (my_html_content) );

    loop
    vLinje := recB.Rad;
    UTL_FILE.PUT_LINE(vFil,substr(vLinje,1,32767));
    end loop;

    UTL_FILE.FCLOSE(vFil);
    UTL_FILE.FRENAME('MY_DIRECTORY',vFilNavn||'.tmp', 'MY_DIRECTORY',vFilNavn||'.html',TRUE);









    share|improve this question


























      0












      0








      0








      I need to save a html file as utf 8. This is not about . Is this possible? In short my procedure is like this:



      CREATE OR REPLACE PROCEDURE MY_PROCEDURE
      IS

      vFil UTL_FILE.FILE_TYPE;
      vFilNavn varchar2(250);
      vLinje varchar2(32767);

      begin
      vFil := UTL_FILE.FOPEN ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767);
      UTL_FILE.PUT_LINE(vFil,vLinje);
      end;

      FOR recB in (select row from (my_html_content) );

      loop
      vLinje := recB.Rad;
      UTL_FILE.PUT_LINE(vFil,substr(vLinje,1,32767));
      end loop;

      UTL_FILE.FCLOSE(vFil);
      UTL_FILE.FRENAME('MY_DIRECTORY',vFilNavn||'.tmp', 'MY_DIRECTORY',vFilNavn||'.html',TRUE);









      share|improve this question














      I need to save a html file as utf 8. This is not about . Is this possible? In short my procedure is like this:



      CREATE OR REPLACE PROCEDURE MY_PROCEDURE
      IS

      vFil UTL_FILE.FILE_TYPE;
      vFilNavn varchar2(250);
      vLinje varchar2(32767);

      begin
      vFil := UTL_FILE.FOPEN ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767);
      UTL_FILE.PUT_LINE(vFil,vLinje);
      end;

      FOR recB in (select row from (my_html_content) );

      loop
      vLinje := recB.Rad;
      UTL_FILE.PUT_LINE(vFil,substr(vLinje,1,32767));
      end loop;

      UTL_FILE.FCLOSE(vFil);
      UTL_FILE.FRENAME('MY_DIRECTORY',vFilNavn||'.tmp', 'MY_DIRECTORY',vFilNavn||'.html',TRUE);






      oracle plsql utl-file






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 11:08









      Johnny GunnJohnny Gunn

      61 bronze badge




      61 bronze badge

























          1 Answer
          1






          active

          oldest

          votes


















          1
















          Use UTL_FILE.FOPEN_NCHAR instead of UTL_FILE.FOPEN.



          See Oracle documentation UTL_FILE:




          UTL_FILE expects that files opened by UTL_FILE.FOPEN in text mode are
          encoded in the database character set. It expects that files opened by
          UTL_FILE.FOPEN_NCHAR in text mode are encoded in the UTF8 character
          set
          .



          FOPEN_NCHAR Function



          Even though the contents of an NVARCHAR2 buffer may be AL16UTF16 or
          UTF8 (depending on the national character set of the database), the
          contents of the file are always read and written in UTF8.







          share|improve this answer

























          • I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

            – Johnny Gunn
            Apr 7 at 16:57












          • Can you make a simple select on the data. Is the output correct?

            – Wernfried Domscheit
            Apr 7 at 17:32











          • Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

            – Johnny Gunn
            Apr 10 at 8:16











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55396070%2fsave-to-html-using-utf-8%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1
















          Use UTL_FILE.FOPEN_NCHAR instead of UTL_FILE.FOPEN.



          See Oracle documentation UTL_FILE:




          UTL_FILE expects that files opened by UTL_FILE.FOPEN in text mode are
          encoded in the database character set. It expects that files opened by
          UTL_FILE.FOPEN_NCHAR in text mode are encoded in the UTF8 character
          set
          .



          FOPEN_NCHAR Function



          Even though the contents of an NVARCHAR2 buffer may be AL16UTF16 or
          UTF8 (depending on the national character set of the database), the
          contents of the file are always read and written in UTF8.







          share|improve this answer

























          • I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

            – Johnny Gunn
            Apr 7 at 16:57












          • Can you make a simple select on the data. Is the output correct?

            – Wernfried Domscheit
            Apr 7 at 17:32











          • Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

            – Johnny Gunn
            Apr 10 at 8:16
















          1
















          Use UTL_FILE.FOPEN_NCHAR instead of UTL_FILE.FOPEN.



          See Oracle documentation UTL_FILE:




          UTL_FILE expects that files opened by UTL_FILE.FOPEN in text mode are
          encoded in the database character set. It expects that files opened by
          UTL_FILE.FOPEN_NCHAR in text mode are encoded in the UTF8 character
          set
          .



          FOPEN_NCHAR Function



          Even though the contents of an NVARCHAR2 buffer may be AL16UTF16 or
          UTF8 (depending on the national character set of the database), the
          contents of the file are always read and written in UTF8.







          share|improve this answer

























          • I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

            – Johnny Gunn
            Apr 7 at 16:57












          • Can you make a simple select on the data. Is the output correct?

            – Wernfried Domscheit
            Apr 7 at 17:32











          • Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

            – Johnny Gunn
            Apr 10 at 8:16














          1














          1










          1









          Use UTL_FILE.FOPEN_NCHAR instead of UTL_FILE.FOPEN.



          See Oracle documentation UTL_FILE:




          UTL_FILE expects that files opened by UTL_FILE.FOPEN in text mode are
          encoded in the database character set. It expects that files opened by
          UTL_FILE.FOPEN_NCHAR in text mode are encoded in the UTF8 character
          set
          .



          FOPEN_NCHAR Function



          Even though the contents of an NVARCHAR2 buffer may be AL16UTF16 or
          UTF8 (depending on the national character set of the database), the
          contents of the file are always read and written in UTF8.







          share|improve this answer













          Use UTL_FILE.FOPEN_NCHAR instead of UTL_FILE.FOPEN.



          See Oracle documentation UTL_FILE:




          UTL_FILE expects that files opened by UTL_FILE.FOPEN in text mode are
          encoded in the database character set. It expects that files opened by
          UTL_FILE.FOPEN_NCHAR in text mode are encoded in the UTF8 character
          set
          .



          FOPEN_NCHAR Function



          Even though the contents of an NVARCHAR2 buffer may be AL16UTF16 or
          UTF8 (depending on the national character set of the database), the
          contents of the file are always read and written in UTF8.








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 28 at 13:24









          Wernfried DomscheitWernfried Domscheit

          27k4 gold badges34 silver badges62 bronze badges




          27k4 gold badges34 silver badges62 bronze badges















          • I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

            – Johnny Gunn
            Apr 7 at 16:57












          • Can you make a simple select on the data. Is the output correct?

            – Wernfried Domscheit
            Apr 7 at 17:32











          • Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

            – Johnny Gunn
            Apr 10 at 8:16


















          • I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

            – Johnny Gunn
            Apr 7 at 16:57












          • Can you make a simple select on the data. Is the output correct?

            – Wernfried Domscheit
            Apr 7 at 17:32











          • Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

            – Johnny Gunn
            Apr 10 at 8:16

















          I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

          – Johnny Gunn
          Apr 7 at 16:57






          I assume like this: vFil := UTL_FILE.FOPEN_NCHAR ('MY_DIRECTORY',vFilNavn||'.tmp','w',32767); And also: UTL_FILE.PUT_NCHAR(vFil,substr(vLinje,1,32767)); ? Still I'm getting ORA-29298 Character set mismatch

          – Johnny Gunn
          Apr 7 at 16:57














          Can you make a simple select on the data. Is the output correct?

          – Wernfried Domscheit
          Apr 7 at 17:32





          Can you make a simple select on the data. Is the output correct?

          – Wernfried Domscheit
          Apr 7 at 17:32













          Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

          – Johnny Gunn
          Apr 10 at 8:16






          Yes, it works fine without NCHAR. It is a html-code into varchar2. And the web-page also are as accepted. But the web-designer need the file to be saved as utf-8. My regional settings are Norwegian.

          – Johnny Gunn
          Apr 10 at 8:16









          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















          draft saved

          draft discarded















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid …


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55396070%2fsave-to-html-using-utf-8%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

          Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?